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

fix(jest-haste-map): don't throw on missing mapper in Node crawler #8558

Merged
merged 3 commits into from Jun 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -12,6 +12,7 @@
- `[babel-plugin-jest-hoist]` Expand list of whitelisted globals in global mocks ([#8429](https://github.com/facebook/jest/pull/8429)
- `[jest-core]` Make watch plugin initialization errors look nice ([#8422](https://github.com/facebook/jest/pull/8422))
- `[jest-snapshot]` Prevent inline snapshots from drifting when inline snapshots are updated ([#8492](https://github.com/facebook/jest/pull/8492))
- `[jest-haste-map]` Don't throw on missing mapper in Node crawler ([#8558](https://github.com/facebook/jest/pull/8558))

### Chore & Maintenance

Expand Down
1 change: 1 addition & 0 deletions packages/jest-haste-map/src/__tests__/index.test.js
Expand Up @@ -426,6 +426,7 @@ describe('HasteMap', () => {
const hasteMap = new HasteMap({
...defaultConfig,
computeSha1: true,
mapper: file => [file],
maxWorkers: 1,
useWatchman,
});
Expand Down
4 changes: 0 additions & 4 deletions packages/jest-haste-map/src/crawlers/node.ts
Expand Up @@ -139,10 +139,6 @@ export = function nodeCrawl(
removedFiles: FileData;
hasteMap: InternalHasteMap;
}> {
if (options.mapper) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this makes sense, not sure why it'd need to throw. Maybe someone has a good reason, though 😀

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea. There are other options we ignore in Node crawler (like computeSha1). Maybe it was some kind of development helper that wasn't removed? Anyway, it's gone now :P

throw new Error(`Option 'mapper' isn't supported by the Node crawler`);
}

const {
data,
extensions,
Expand Down