Skip to content

Commit

Permalink
Allow Jest to run tests in node_modules
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
pauldraper committed Feb 20, 2022
1 parent 7d4595e commit c5f23c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/jest-runtime/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ export default class Runtime {
name: config.name,
platforms: config.haste.platforms || ['ios', 'android'],
resetCache: options?.resetCache,
retainAllFiles: false,
retainAllFiles: true,
rootDir: config.rootDir,
roots: config.roots,
throwOnModuleCollision: config.haste.throwOnModuleCollision,
Expand Down

0 comments on commit c5f23c7

Please sign in to comment.