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,
|
resetCache: opts.resetCache,
|
||||||
retainAllFiles: true,
|
retainAllFiles: true,
|
||||||
roots: opts.roots,
|
roots: opts.roots,
|
||||||
|
throwOnModuleCollision: true,
|
||||||
useWatchman: opts.useWatchman,
|
useWatchman: opts.useWatchman,
|
||||||
watch: opts.watch,
|
watch: opts.watch,
|
||||||
});
|
});
|
||||||
|
|
|
@ -1127,14 +1127,13 @@ describe('DependencyGraph', function() {
|
||||||
|
|
||||||
return dgraph.catch(err => {
|
return dgraph.catch(err => {
|
||||||
expect(err.message).toEqual(
|
expect(err.message).toEqual(
|
||||||
`Failed to build DependencyGraph: @providesModule naming collision:\n` +
|
'jest-haste-map: @providesModule naming collision:\n' +
|
||||||
` Duplicate module name: index\n` +
|
` Duplicate module name: index\n` +
|
||||||
` Paths: /root/b.js collides with /root/index.js\n\n` +
|
` Paths: /root/b.js collides with /root/index.js\n\n` +
|
||||||
'This error is caused by a @providesModule declaration ' +
|
'This error is caused by a @providesModule declaration ' +
|
||||||
'with the same name across two different files.',
|
'with the same name across two different files.',
|
||||||
);
|
);
|
||||||
expect(err.type).toEqual('DependencyGraphError');
|
expect(console.warn).not.toBeCalled();
|
||||||
expect(console.warn).toBeCalled();
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue