From a687e26c05add184d118cbcb7933e592aadaffbd Mon Sep 17 00:00:00 2001 From: Justin Falcone Date: Fri, 9 Dec 2016 10:32:14 -0500 Subject: [PATCH] WIP: haste ignores using testPathIgnorePatterns, not all node_modules --- packages/jest-haste-map/src/index.js | 5 +---- packages/jest-runtime/src/index.js | 4 +++- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/jest-haste-map/src/index.js b/packages/jest-haste-map/src/index.js index dd0d8747f642..47121254e789 100644 --- a/packages/jest-haste-map/src/index.js +++ b/packages/jest-haste-map/src/index.js @@ -672,10 +672,7 @@ class HasteMap extends EventEmitter { * Helpers */ _ignore(filePath: Path): boolean { - return ( - this._options.ignorePattern.test(filePath) || - (!this._options.retainAllFiles && this._isNodeModulesDir(filePath)) - ); + return this._options.ignorePattern.test(filePath); } _isNodeModulesDir(filePath: Path): boolean { diff --git a/packages/jest-runtime/src/index.js b/packages/jest-runtime/src/index.js index 68b07ec81286..d41d431975f6 100644 --- a/packages/jest-runtime/src/index.js +++ b/packages/jest-runtime/src/index.js @@ -195,7 +195,9 @@ class Runtime { options?: HasteMapOptions, ): HasteMap { const ignorePattern = new RegExp( - [config.cacheDirectory].concat(config.modulePathIgnorePatterns).join('|'), + [config.cacheDirectory].concat( + config.modulePathIgnorePatterns, + config.testPathIgnorePatterns).join('|'), ); return new HasteMap({