diff --git a/CHANGELOG.md b/CHANGELOG.md index 13b20390b701..a33bbe692568 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/packages/jest-haste-map/src/__tests__/index.test.js b/packages/jest-haste-map/src/__tests__/index.test.js index a24f9c3bddbf..196094edd1c8 100644 --- a/packages/jest-haste-map/src/__tests__/index.test.js +++ b/packages/jest-haste-map/src/__tests__/index.test.js @@ -426,6 +426,7 @@ describe('HasteMap', () => { const hasteMap = new HasteMap({ ...defaultConfig, computeSha1: true, + mapper: file => [file], maxWorkers: 1, useWatchman, }); diff --git a/packages/jest-haste-map/src/crawlers/node.ts b/packages/jest-haste-map/src/crawlers/node.ts index 71ee6c053a3b..87bcb00b9680 100644 --- a/packages/jest-haste-map/src/crawlers/node.ts +++ b/packages/jest-haste-map/src/crawlers/node.ts @@ -139,10 +139,6 @@ export = function nodeCrawl( removedFiles: FileData; hasteMap: InternalHasteMap; }> { - if (options.mapper) { - throw new Error(`Option 'mapper' isn't supported by the Node crawler`); - } - const { data, extensions,