Skip to content

Commit 76b1fc1

Browse files
Christopher RobertsChristopher Roberts
authored andcommitted
fix: Allow searching for tests in node_modules
1 parent 42f78d4 commit 76b1fc1

File tree

5 files changed

+7
-0
lines changed

5 files changed

+7
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
- `[jest-worker]` Do not swallow errors during serialization ([#10984](https://github.com/facebook/jest/pull/10984))
5757
- `[pretty-format]` [**BREAKING**] Convert to ES Modules ([#10515](https://github.com/facebook/jest/pull/10515))
5858
- `[pretty-format]` Only call `hasAttribute` if it's a function ([#11000](https://github.com/facebook/jest/pull/11000))
59+
- `[jest-config]` Allow searching for tests in node_modules by exposing `retainAllFiles` ([#11084](https://github.com/facebook/jest/pull/11084))
5960

6061
### Chore & Maintenance
6162

docs/Configuration.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,8 @@ type HasteConfig = {
499499
platforms?: Array<string>;
500500
// Whether to throw on error on module collision.
501501
throwOnModuleCollision?: boolean;
502+
// Whether to search for tests in node_modules.
503+
retainAllFiles?: boolean;
502504
};
503505
```
504506

packages/jest-config/src/ValidConfig.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ const initialOptions: Config.InitialOptions = {
5858
hasteImplModulePath: '<rootDir>/haste_impl.js',
5959
platforms: ['ios', 'android'],
6060
throwOnModuleCollision: false,
61+
retainAllFiles: false
6162
},
6263
injectGlobals: true,
6364
json: false,

packages/jest-haste-map/src/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export type WorkerMessage = {
1919
rootDir: string;
2020
filePath: string;
2121
hasteImplModulePath?: string;
22+
retainAllFiles?: boolean;
2223
};
2324

2425
export type WorkerMetadata = {

packages/jest-types/src/Config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ export type HasteConfig = {
2828
platforms?: Array<string>;
2929
/** Whether to throw on error on module collision. */
3030
throwOnModuleCollision?: boolean;
31+
/** Whether to search for tests in node_modules. */
32+
retainAllFiles?: boolean;
3133
};
3234

3335
export type CoverageReporterName = keyof ReportOptions;

0 commit comments

Comments
 (0)