packager: upgrade jest-haste-map version

Summary: This allows us to get the new fix for recovery on duplicate modules.

Reviewed By: cpojer

Differential Revision: D5128975

fbshipit-source-id: 5a2b60430bbca1806a97798c482af8522366e071
This commit is contained in:
Jean Lauliac 2017-05-25 05:01:34 -07:00 committed by Facebook Github Bot
parent a4badb8471
commit 7c06a0da65
5 changed files with 45 additions and 15 deletions

View File

@ -176,7 +176,7 @@
"graceful-fs": "^4.1.3", "graceful-fs": "^4.1.3",
"image-size": "^0.3.5", "image-size": "^0.3.5",
"inquirer": "^0.12.0", "inquirer": "^0.12.0",
"jest-haste-map": "19.0.0", "jest-haste-map": "^20.0.4",
"json-stable-stringify": "^1.0.1", "json-stable-stringify": "^1.0.1",
"json5": "^0.4.0", "json5": "^0.4.0",
"left-pad": "^1.1.3", "left-pad": "^1.1.3",

View File

@ -24,7 +24,7 @@
"fbjs": "0.8.12", "fbjs": "0.8.12",
"graceful-fs": "^4.1.3", "graceful-fs": "^4.1.3",
"image-size": "^0.3.5", "image-size": "^0.3.5",
"jest-haste-map": "19.0.0", "jest-haste-map": "^20.0.4",
"json-stable-stringify": "^1.0.1", "json-stable-stringify": "^1.0.1",
"json5": "^0.4.0", "json5": "^0.4.0",
"left-pad": "^1.1.3", "left-pad": "^1.1.3",

View File

@ -111,7 +111,7 @@ class DependencyGraph extends EventEmitter {
return new JestHasteMap({ return new JestHasteMap({
extensions: opts.sourceExts.concat(opts.assetExts), extensions: opts.sourceExts.concat(opts.assetExts),
forceNodeFilesystemAPI: opts.forceNodeFilesystemAPI, forceNodeFilesystemAPI: opts.forceNodeFilesystemAPI,
ignorePattern: {test: opts.ignoreFilePath}, ignorePattern: opts.ignoreFilePath,
maxWorkers: opts.maxWorkerCount, maxWorkers: opts.maxWorkerCount,
mocksPattern: '', mocksPattern: '',
name: 'react-native-packager-' + JEST_HASTE_MAP_CACHE_BREAKER, name: 'react-native-packager-' + JEST_HASTE_MAP_CACHE_BREAKER,

View File

@ -5398,7 +5398,7 @@ describe('DependencyGraph', function() {
}); });
}); });
it('should recover from multiple modules with the same name (but this is broken right now)', async () => { it('should recover from multiple modules with the same name', async () => {
const root = '/root'; const root = '/root';
console.warn = jest.fn(); console.warn = jest.fn();
const filesystem = setMockFileSystem({ const filesystem = setMockFileSystem({
@ -5435,17 +5435,11 @@ describe('DependencyGraph', function() {
await triggerAndProcessWatchEvent(dgraph, 'change', root + '/b.js'); await triggerAndProcessWatchEvent(dgraph, 'change', root + '/b.js');
} }
// This verifies that it is broken right now. Instead of throwing it should const deps = await getOrderedDependenciesAsJSON(
// return correct results. Once this is fixed in `jest-haste`, remove dgraph,
// the whole try catch and verify results are matching a snapshot. root + '/index.js',
try { );
await getOrderedDependenciesAsJSON(dgraph, root + '/index.js'); expect(deps).toMatchSnapshot();
throw new Error('expected `getOrderedDependenciesAsJSON` to fail');
} catch (error) {
if (error.type !== 'UnableToResolveError') {
throw error;
}
}
}); });
}); });

View File

@ -0,0 +1,36 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`DependencyGraph file watch updating should recover from multiple modules with the same name 1`] = `
Array [
Object {
"dependencies": Array [
"a",
"b",
],
"id": "index",
"isAsset": false,
"isJSON": false,
"isPolyfill": false,
"path": "/root/index.js",
"resolution": undefined,
},
Object {
"dependencies": Array [],
"id": "a",
"isAsset": false,
"isJSON": false,
"isPolyfill": false,
"path": "/root/a.js",
"resolution": undefined,
},
Object {
"dependencies": Array [],
"id": "b",
"isAsset": false,
"isJSON": false,
"isPolyfill": false,
"path": "/root/b.js",
"resolution": undefined,
},
]
`;