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. Reviewed By: cpojer Differential Revision: D5433438 fbshipit-source-id: 47cad9ca6bf0bdec91a158ccb2807b6c5571966a
This commit is contained in:
parent
ffbc1c80a8
commit
40c4317086
|
@ -5294,7 +5294,10 @@ describe('DependencyGraph', function() {
|
||||||
await getOrderedDependenciesAsJSON(dgraph, root + '/index.js');
|
await getOrderedDependenciesAsJSON(dgraph, root + '/index.js');
|
||||||
throw new Error('expected `getOrderedDependenciesAsJSON` to fail');
|
throw new Error('expected `getOrderedDependenciesAsJSON` to fail');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error.type !== 'UnableToResolveError') {
|
const {
|
||||||
|
DuplicateHasteCandidatesError,
|
||||||
|
} = require('jest-haste-map/build/module_map');
|
||||||
|
if (!(error instanceof DuplicateHasteCandidatesError)) {
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
expect(console.warn).toBeCalled();
|
expect(console.warn).toBeCalled();
|
||||||
|
|
Loading…
Reference in New Issue