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 68e6841
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 @@ -57,6 +57,7 @@ const initialOptions: Config.InitialOptions = {
defaultPlatform: 'ios',
hasteImplModulePath: '<rootDir>/haste_impl.js',
platforms: ['ios', 'android'],
retainAllFiles: false,
throwOnModuleCollision: false,
},
injectGlobals: true,
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 68e6841

Please sign in to comment.