packager: enable throwOnModuleCollision for jest-haste-map

Reviewed By: davidaurelio

Differential Revision: D5129231

fbshipit-source-id: dbb8f0096c29efaca865a788fb25c21c9cbbc5cb
This commit is contained in:
Jean Lauliac 2017-05-25 07:37:42 -07:00 committed by Facebook Github Bot
parent feec96b762
commit e155303543
2 changed files with 3 additions and 3 deletions

View File

@ -120,6 +120,7 @@ class DependencyGraph extends EventEmitter {
resetCache: opts.resetCache,
retainAllFiles: true,
roots: opts.roots,
throwOnModuleCollision: true,
useWatchman: opts.useWatchman,
watch: opts.watch,
});

View File

@ -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();
});
});