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

Summary: Now we have a nice specific error type for duplicates errors.

Reviewed By: cpojer

Differential Revision: D5433438

fbshipit-source-id: 47cad9ca6bf0bdec91a158ccb2807b6c5571966a
This commit is contained in:
Jean Lauliac 2017-07-17 09:24:16 -07:00 committed by Facebook Github Bot
parent ffbc1c80a8
commit 40c4317086
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();