Merge pull request #14208 from rozele/0.45-stable

packager: upgrade jest-haste-map version
This commit is contained in:
Mike Grabowski
2017-05-26 15:51:38 +02:00
committed by GitHub
5 changed files with 45 additions and 15 deletions
+1 -1
View File
@@ -170,7 +170,7 @@
"graceful-fs": "^4.1.3",
"image-size": "^0.3.5",
"inquirer": "^0.12.0",
"jest-haste-map": "19.0.0",
"jest-haste-map": "^20.0.4",
"joi": "^6.6.1",
"json-stable-stringify": "^1.0.1",
"json5": "^0.4.0",
+1 -1
View File
@@ -25,7 +25,7 @@
"graceful-fs": "^4.1.3",
"image-size": "^0.3.5",
"imurmurhash": "^0.1.4",
"jest-haste-map": "18.0.0",
"jest-haste-map": "^20.0.4",
"joi": "^6.6.1",
"json-stable-stringify": "^1.0.1",
"json5": "^0.4.0",
+1 -1
View File
@@ -105,7 +105,7 @@ class DependencyGraph extends EventEmitter {
return new JestHasteMap({
extensions: opts.sourceExts.concat(opts.assetExts),
forceNodeFilesystemAPI: opts.forceNodeFilesystemAPI,
ignorePattern: {test: opts.ignoreFilePath},
ignorePattern: opts.ignoreFilePath,
maxWorkers: opts.maxWorkerCount,
mocksPattern: '',
name: 'react-native-packager-' + JEST_HASTE_MAP_CACHE_BREAKER,
@@ -5152,7 +5152,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';
console.warn = jest.fn();
const filesystem = setMockFileSystem({
@@ -5201,17 +5201,11 @@ describe('DependencyGraph', function() {
await triggerAndProcessWatchEvent(dgraph, 'change', root + '/b.js');
}
// This verifies that it is broken right now. Instead of throwing it should
// return correct results. Once this is fixed in `jest-haste`, remove
// the whole try catch and verify results are matching a snapshot.
try {
await getOrderedDependenciesAsJSON(dgraph, root + '/index.js');
throw new Error('expected `getOrderedDependenciesAsJSON` to fail');
} catch (error) {
if (error.type !== 'UnableToResolveError') {
throw error;
}
}
const deps = await getOrderedDependenciesAsJSON(
dgraph,
root + '/index.js',
);
expect(deps).toMatchSnapshot();
});
});
@@ -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,
},
]
`;