Skip to content

Commit 43d1cf6

Browse files
thymikeecpojer
authored andcommitted
fix(jest-haste-map): don't throw on missing mapper in Node crawler (#8558)
* fix(jest-haste-map): don't pass mapper to Node crawler * add changelog * get rid of throwing when mapper passed to node crawler
1 parent 3748557 commit 43d1cf6

File tree

3 files changed

+2
-4
lines changed

3 files changed

+2
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
- `[babel-plugin-jest-hoist]` Expand list of whitelisted globals in global mocks ([#8429](https://github.com/facebook/jest/pull/8429)
1313
- `[jest-core]` Make watch plugin initialization errors look nice ([#8422](https://github.com/facebook/jest/pull/8422))
1414
- `[jest-snapshot]` Prevent inline snapshots from drifting when inline snapshots are updated ([#8492](https://github.com/facebook/jest/pull/8492))
15+
- `[jest-haste-map]` Don't throw on missing mapper in Node crawler ([#8558](https://github.com/facebook/jest/pull/8558))
1516

1617
### Chore & Maintenance
1718

packages/jest-haste-map/src/__tests__/index.test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,7 @@ describe('HasteMap', () => {
426426
const hasteMap = new HasteMap({
427427
...defaultConfig,
428428
computeSha1: true,
429+
mapper: file => [file],
429430
maxWorkers: 1,
430431
useWatchman,
431432
});

packages/jest-haste-map/src/crawlers/node.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,6 @@ export = function nodeCrawl(
139139
removedFiles: FileData;
140140
hasteMap: InternalHasteMap;
141141
}> {
142-
if (options.mapper) {
143-
throw new Error(`Option 'mapper' isn't supported by the Node crawler`);
144-
}
145-
146142
const {
147143
data,
148144
extensions,

0 commit comments

Comments
 (0)