metro-bunder: fix DependencyGraph-test for new jest-haste-map duplicates API

Summary: Now we have a nice specific error type for duplicates errors. This changeset have been commited before but was reverted as part of a stack, so here we go again.

Reviewed By: cpojer

Differential Revision: D5442363

fbshipit-source-id: 068c8decaf20cd4f9a73d9d54984030c79cff606
This commit is contained in:
Jean Lauliac 2017-07-18 07:57:42 -07:00 committed by Facebook Github Bot
parent be9219b852
commit 9815cd6e6f
1 changed files with 4 additions and 1 deletions

View File

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