From 9dad135be138b3802dc553961ae93f3c6545bebb Mon Sep 17 00:00:00 2001 From: Jean Lauliac Date: Mon, 5 Jun 2017 03:58:42 -0700 Subject: [PATCH] Revert D5129231: packager: enable throwOnModuleCollision for jest-haste-map Differential Revision: D5129231 fbshipit-source-id: 23e7f9246b55773dab98ee0cbcf38b1c8d5b4f30 --- packages/metro-bundler/src/node-haste/DependencyGraph.js | 1 - .../src/node-haste/__tests__/DependencyGraph-test.js | 5 +++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/metro-bundler/src/node-haste/DependencyGraph.js b/packages/metro-bundler/src/node-haste/DependencyGraph.js index 39410a03..5e1c1154 100644 --- a/packages/metro-bundler/src/node-haste/DependencyGraph.js +++ b/packages/metro-bundler/src/node-haste/DependencyGraph.js @@ -118,7 +118,6 @@ class DependencyGraph extends EventEmitter { resetCache: opts.resetCache, retainAllFiles: true, roots: opts.roots, - throwOnModuleCollision: true, useWatchman: opts.useWatchman, watch: opts.watch, }); diff --git a/packages/metro-bundler/src/node-haste/__tests__/DependencyGraph-test.js b/packages/metro-bundler/src/node-haste/__tests__/DependencyGraph-test.js index c2cb54e9..34b0cf41 100644 --- a/packages/metro-bundler/src/node-haste/__tests__/DependencyGraph-test.js +++ b/packages/metro-bundler/src/node-haste/__tests__/DependencyGraph-test.js @@ -1127,13 +1127,14 @@ describe('DependencyGraph', function() { return dgraph.catch(err => { expect(err.message).toEqual( - 'jest-haste-map: @providesModule naming collision:\n' + + `Failed to build DependencyGraph: @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(console.warn).not.toBeCalled(); + expect(err.type).toEqual('DependencyGraphError'); + expect(console.warn).toBeCalled(); }); });