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 277d36b7..ae8cfe32 100644 --- a/packages/metro-bundler/src/node-haste/__tests__/DependencyGraph-test.js +++ b/packages/metro-bundler/src/node-haste/__tests__/DependencyGraph-test.js @@ -5294,7 +5294,10 @@ describe('DependencyGraph', function() { await getOrderedDependenciesAsJSON(dgraph, root + '/index.js'); throw new Error('expected `getOrderedDependenciesAsJSON` to fail'); } catch (error) { - if (error.type !== 'UnableToResolveError') { + const { + DuplicateHasteCandidatesError, + } = require('jest-haste-map/build/module_map'); + if (!(error instanceof DuplicateHasteCandidatesError)) { throw error; } expect(console.warn).toBeCalled();