Skip to content

Commit

Permalink
fix: Allow searching for tests in node_modules
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher Roberts authored and Christopher Roberts committed Feb 13, 2021
1 parent 42f78d4 commit 76b1fc1
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
- `[jest-worker]` Do not swallow errors during serialization ([#10984](https://github.com/facebook/jest/pull/10984))
- `[pretty-format]` [**BREAKING**] Convert to ES Modules ([#10515](https://github.com/facebook/jest/pull/10515))
- `[pretty-format]` Only call `hasAttribute` if it's a function ([#11000](https://github.com/facebook/jest/pull/11000))
- `[jest-config]` Allow searching for tests in node_modules by exposing `retainAllFiles` ([#11084](https://github.com/facebook/jest/pull/11084))

### Chore & Maintenance

Expand Down
2 changes: 2 additions & 0 deletions docs/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,8 @@ type HasteConfig = {
platforms?: Array<string>;
// Whether to throw on error on module collision.
throwOnModuleCollision?: boolean;
// Whether to search for tests in node_modules.
retainAllFiles?: boolean;
};
```

Expand Down
1 change: 1 addition & 0 deletions packages/jest-config/src/ValidConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ const initialOptions: Config.InitialOptions = {
hasteImplModulePath: '<rootDir>/haste_impl.js',
platforms: ['ios', 'android'],
throwOnModuleCollision: false,
retainAllFiles: false
},
injectGlobals: true,
json: false,
Expand Down
1 change: 1 addition & 0 deletions packages/jest-haste-map/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export type WorkerMessage = {
rootDir: string;
filePath: string;
hasteImplModulePath?: string;
retainAllFiles?: boolean;
};

export type WorkerMetadata = {
Expand Down
2 changes: 2 additions & 0 deletions packages/jest-types/src/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ export type HasteConfig = {
platforms?: Array<string>;
/** Whether to throw on error on module collision. */
throwOnModuleCollision?: boolean;
/** Whether to search for tests in node_modules. */
retainAllFiles?: boolean;
};

export type CoverageReporterName = keyof ReportOptions;
Expand Down

0 comments on commit 76b1fc1

Please sign in to comment.