mirror of https://github.com/status-im/metro.git
packager: enable throwOnModuleCollision for jest-haste-map
Reviewed By: davidaurelio Differential Revision: D5129231 fbshipit-source-id: dbb8f0096c29efaca865a788fb25c21c9cbbc5cb
This commit is contained in:
parent
feec96b762
commit
e155303543
|
@ -120,6 +120,7 @@ class DependencyGraph extends EventEmitter {
|
|||
resetCache: opts.resetCache,
|
||||
retainAllFiles: true,
|
||||
roots: opts.roots,
|
||||
throwOnModuleCollision: true,
|
||||
useWatchman: opts.useWatchman,
|
||||
watch: opts.watch,
|
||||
});
|
||||
|
|
|
@ -1127,14 +1127,13 @@ describe('DependencyGraph', function() {
|
|||
|
||||
return dgraph.catch(err => {
|
||||
expect(err.message).toEqual(
|
||||
`Failed to build DependencyGraph: @providesModule naming collision:\n` +
|
||||
'jest-haste-map: @providesModule naming collision:\n' +
|
||||
` Duplicate module name: index\n` +
|
||||
` Paths: /root/b.js collides with /root/index.js\n\n` +
|
||||
'This error is caused by a @providesModule declaration ' +
|
||||
'with the same name across two different files.',
|
||||
);
|
||||
expect(err.type).toEqual('DependencyGraphError');
|
||||
expect(console.warn).toBeCalled();
|
||||
expect(console.warn).not.toBeCalled();
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue