mirror of https://github.com/status-im/metro.git
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:
parent
be9219b852
commit
9815cd6e6f
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue