Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

packager: upgrade jest-haste-map version #14194

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
"immutable": "~3.7.6",
"imurmurhash": "^0.1.4",
"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",
Expand Down
2 changes: 1 addition & 1 deletion packager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
18 changes: 6 additions & 12 deletions packager/src/node-haste/__tests__/DependencyGraph-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5182,7 +5182,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({
Expand Down Expand Up @@ -5231,17 +5231,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();
});

});
Expand Down
Original file line number Diff line number Diff line change
@@ -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,
},
]
`;
2 changes: 1 addition & 1 deletion packager/src/node-haste/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class DependencyGraph extends EventEmitter {
return new JestHasteMap({
extensions: opts.extensions.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,
Expand Down