From 43d1cf6ad49b00c077c01560bbedc9fc8c61311d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pierzcha=C5=82a?= Date: Thu, 13 Jun 2019 10:30:46 +0200 Subject: [PATCH] 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 --- CHANGELOG.md | 1 + packages/jest-haste-map/src/__tests__/index.test.js | 1 + packages/jest-haste-map/src/crawlers/node.ts | 4 ---- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ef6cb5bb8d9..c9b964f9d1b4 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,