Skip to content

Commit c5f23c7

Browse files
committed
Allow Jest to run tests in node_modules
Resolves jestjs#2145 and jestjs#11781. Prevent haste map from automatically discarding node_modules files. By default, node_modules is still excluded via the testPathIgnorePatterns option. However, users can now use that option to allow node_modules without hacks.
1 parent 7d4595e commit c5f23c7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/jest-runtime/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ export default class Runtime {
386386
name: config.name,
387387
platforms: config.haste.platforms || ['ios', 'android'],
388388
resetCache: options?.resetCache,
389-
retainAllFiles: false,
389+
retainAllFiles: true,
390390
rootDir: config.rootDir,
391391
roots: config.roots,
392392
throwOnModuleCollision: config.haste.throwOnModuleCollision,

0 commit comments

Comments
 (0)