Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(@jest/types): mark collectCoverageOnlyFrom and coveragePathIgnorePatterns options deprecated #12914

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
- `[docs]` Document the comments used by coverage providers [#12835](https://github.com/facebook/jest/issues/12835)
- `[docs]` Use `docusaurus-remark-plugin-tab-blocks` to format tabs with code examples ([#12859](https://github.com/facebook/jest/pull/12859))
- `[jest-haste-map]` Bump `walker` version ([#12324](https://github.com/facebook/jest/pull/12324))
- `[@jest/types]` Mark `collectCoverageOnlyFrom` and `coveragePathIgnorePatterns` options as deprecated ([#12914](https://github.com/facebook/jest/pull/12914))

### Performance

Expand Down
8 changes: 0 additions & 8 deletions docs/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,14 +265,6 @@ Default: `undefined`

The directory where Jest should output its coverage files.

### `coveragePathIgnorePatterns` \[array<string>]

Default: `["/node_modules/"]`

An array of regexp pattern strings that are matched against all file paths before executing the test. If the file path matches any of the patterns, coverage information will be skipped.

These pattern strings match against the full path. Use the `<rootDir>` string token to include the path to your project's root directory to prevent it from accidentally ignoring all of your files in different environments that may have different root directories. Example: `["<rootDir>/build/", "<rootDir>/node_modules/"]`.

### `coverageProvider` \[string]

Indicates which provider should be used to instrument code for coverage. Allowed values are `babel` (default) or `v8`.
Expand Down
4 changes: 2 additions & 2 deletions docs/Troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,9 @@ If you use GitHub Actions, you can use [`github-actions-cpu-cores`](https://gith

Another thing you can do is use the [`shard`](CLI.md#--shard) flag to parallelize the test run across multiple machines.

## `coveragePathIgnorePatterns` seems to not have any effect.
## Negated glob patterns in the `collectCoverageFrom` list seem to not have any effect.

Make sure you are not using the `babel-plugin-istanbul` plugin. Jest wraps Istanbul, and therefore also tells Istanbul what files to instrument with coverage collection. When using `babel-plugin-istanbul`, every file that is processed by Babel will have coverage collection code, hence it is not being ignored by `coveragePathIgnorePatterns`.
Make sure you are not using the `babel-plugin-istanbul` plugin. Jest wraps Istanbul, and therefore also tells Istanbul what files to instrument with coverage collection. When using `babel-plugin-istanbul`, every file that is processed by Babel will have coverage collection code, hence it is not being ignored by the negated glob patterns in the `collectCoverageFrom` list.

## Defining Tests

Expand Down
1 change: 0 additions & 1 deletion docs/WatchPlugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ For stability and safety reasons, only part of the global configuration keys can
- [`changedSince`](cli#--changedsince)
- [`collectCoverage`](configuration#collectcoverage-boolean)
- [`collectCoverageFrom`](configuration#collectcoveragefrom-array)
- [`collectCoverageOnlyFrom`](configuration#collectcoverageonlyfrom-array)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm.. Dead link.

- [`coverageDirectory`](configuration#coveragedirectory-string)
- [`coverageReporters`](configuration#coveragereporters-arraystring)
- [`notify`](configuration#notify-boolean)
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 @@ -231,10 +231,12 @@ export type InitialOptions = Partial<{
changedSince: string;
collectCoverage: boolean;
collectCoverageFrom: Array<string>;
/** @deprecated Use `collectCoverageFrom` option instead */
collectCoverageOnlyFrom: {
[key: string]: boolean;
};
coverageDirectory: string;
/** @deprecated Use `collectCoverageFrom` option instead */
coveragePathIgnorePatterns: Array<string>;
coverageProvider: CoverageProvider;
coverageReporters: CoverageReporters;
Expand Down
8 changes: 0 additions & 8 deletions website/versioned_docs/version-25.x/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,14 +205,6 @@ Default: `undefined`

The directory where Jest should output its coverage files.

### `coveragePathIgnorePatterns` \[array&lt;string&gt;]

Default: `["/node_modules/"]`

An array of regexp pattern strings that are matched against all file paths before executing the test. If the file path matches any of the patterns, coverage information will be skipped.

These pattern strings match against the full path. Use the `<rootDir>` string token to include the path to your project's root directory to prevent it from accidentally ignoring all of your files in different environments that may have different root directories. Example: `["<rootDir>/build/", "<rootDir>/node_modules/"]`.

### `coverageProvider` \[string]

Indicates which provider should be used to instrument code for coverage. Allowed values are `babel` (default) or `v8`.
Expand Down
4 changes: 2 additions & 2 deletions website/versioned_docs/version-25.x/Troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,9 @@ jest --maxWorkers=4
yarn test --maxWorkers=4
```

## `coveragePathIgnorePatterns` seems to not have any effect.
## Negated glob patterns in the `collectCoverageFrom` list seem to not have any effect.

Make sure you are not using the `babel-plugin-istanbul` plugin. Jest wraps Istanbul, and therefore also tells Istanbul what files to instrument with coverage collection. When using `babel-plugin-istanbul`, every file that is processed by Babel will have coverage collection code, hence it is not being ignored by `coveragePathIgnorePatterns`.
Make sure you are not using the `babel-plugin-istanbul` plugin. Jest wraps Istanbul, and therefore also tells Istanbul what files to instrument with coverage collection. When using `babel-plugin-istanbul`, every file that is processed by Babel will have coverage collection code, hence it is not being ignored by the negated glob patterns in the `collectCoverageFrom` list.

## Defining Tests

Expand Down
1 change: 0 additions & 1 deletion website/versioned_docs/version-25.x/WatchPlugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ For stability and safety reasons, only part of the global configuration keys can
- [`changedSince`](cli#--changedsince)
- [`collectCoverage`](configuration#collectcoverage-boolean)
- [`collectCoverageFrom`](configuration#collectcoveragefrom-array)
- [`collectCoverageOnlyFrom`](configuration#collectcoverageonlyfrom-array)
- [`coverageDirectory`](configuration#coveragedirectory-string)
- [`coverageReporters`](configuration#coveragereporters-arraystring)
- [`notify`](configuration#notify-boolean)
Expand Down
8 changes: 0 additions & 8 deletions website/versioned_docs/version-26.x/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,14 +210,6 @@ Default: `undefined`

The directory where Jest should output its coverage files.

### `coveragePathIgnorePatterns` \[array&lt;string&gt;]

Default: `["/node_modules/"]`

An array of regexp pattern strings that are matched against all file paths before executing the test. If the file path matches any of the patterns, coverage information will be skipped.

These pattern strings match against the full path. Use the `<rootDir>` string token to include the path to your project's root directory to prevent it from accidentally ignoring all of your files in different environments that may have different root directories. Example: `["<rootDir>/build/", "<rootDir>/node_modules/"]`.

### `coverageProvider` \[string]

Indicates which provider should be used to instrument code for coverage. Allowed values are `babel` (default) or `v8`.
Expand Down
4 changes: 2 additions & 2 deletions website/versioned_docs/version-26.x/Troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,9 @@ jest --maxWorkers=4
yarn test --maxWorkers=4
```

## `coveragePathIgnorePatterns` seems to not have any effect.
## Negated glob patterns in the `collectCoverageFrom` list seem to not have any effect.

Make sure you are not using the `babel-plugin-istanbul` plugin. Jest wraps Istanbul, and therefore also tells Istanbul what files to instrument with coverage collection. When using `babel-plugin-istanbul`, every file that is processed by Babel will have coverage collection code, hence it is not being ignored by `coveragePathIgnorePatterns`.
Make sure you are not using the `babel-plugin-istanbul` plugin. Jest wraps Istanbul, and therefore also tells Istanbul what files to instrument with coverage collection. When using `babel-plugin-istanbul`, every file that is processed by Babel will have coverage collection code, hence it is not being ignored by the negated glob patterns in the `collectCoverageFrom` list.

## Defining Tests

Expand Down
1 change: 0 additions & 1 deletion website/versioned_docs/version-26.x/WatchPlugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ For stability and safety reasons, only part of the global configuration keys can
- [`changedSince`](cli#--changedsince)
- [`collectCoverage`](configuration#collectcoverage-boolean)
- [`collectCoverageFrom`](configuration#collectcoveragefrom-array)
- [`collectCoverageOnlyFrom`](configuration#collectcoverageonlyfrom-array)
- [`coverageDirectory`](configuration#coveragedirectory-string)
- [`coverageReporters`](configuration#coveragereporters-arraystring)
- [`notify`](configuration#notify-boolean)
Expand Down
8 changes: 0 additions & 8 deletions website/versioned_docs/version-27.x/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,14 +210,6 @@ Default: `undefined`

The directory where Jest should output its coverage files.

### `coveragePathIgnorePatterns` \[array&lt;string&gt;]

Default: `["/node_modules/"]`

An array of regexp pattern strings that are matched against all file paths before executing the test. If the file path matches any of the patterns, coverage information will be skipped.

These pattern strings match against the full path. Use the `<rootDir>` string token to include the path to your project's root directory to prevent it from accidentally ignoring all of your files in different environments that may have different root directories. Example: `["<rootDir>/build/", "<rootDir>/node_modules/"]`.

### `coverageProvider` \[string]

Indicates which provider should be used to instrument code for coverage. Allowed values are `babel` (default) or `v8`.
Expand Down
4 changes: 2 additions & 2 deletions website/versioned_docs/version-27.x/Troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,9 @@ jest --maxWorkers=4
yarn test --maxWorkers=4
```

## `coveragePathIgnorePatterns` seems to not have any effect.
## Negated glob patterns in the `collectCoverageFrom` list seem to not have any effect.

Make sure you are not using the `babel-plugin-istanbul` plugin. Jest wraps Istanbul, and therefore also tells Istanbul what files to instrument with coverage collection. When using `babel-plugin-istanbul`, every file that is processed by Babel will have coverage collection code, hence it is not being ignored by `coveragePathIgnorePatterns`.
Make sure you are not using the `babel-plugin-istanbul` plugin. Jest wraps Istanbul, and therefore also tells Istanbul what files to instrument with coverage collection. When using `babel-plugin-istanbul`, every file that is processed by Babel will have coverage collection code, hence it is not being ignored by the negated glob patterns in the `collectCoverageFrom` list.

## Defining Tests

Expand Down
1 change: 0 additions & 1 deletion website/versioned_docs/version-27.x/WatchPlugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ For stability and safety reasons, only part of the global configuration keys can
- [`changedSince`](cli#--changedsince)
- [`collectCoverage`](configuration#collectcoverage-boolean)
- [`collectCoverageFrom`](configuration#collectcoveragefrom-array)
- [`collectCoverageOnlyFrom`](configuration#collectcoverageonlyfrom-array)
- [`coverageDirectory`](configuration#coveragedirectory-string)
- [`coverageReporters`](configuration#coveragereporters-arraystring)
- [`notify`](configuration#notify-boolean)
Expand Down
8 changes: 0 additions & 8 deletions website/versioned_docs/version-28.0/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,14 +222,6 @@ Default: `undefined`

The directory where Jest should output its coverage files.

### `coveragePathIgnorePatterns` \[array&lt;string&gt;]

Default: `["/node_modules/"]`

An array of regexp pattern strings that are matched against all file paths before executing the test. If the file path matches any of the patterns, coverage information will be skipped.

These pattern strings match against the full path. Use the `<rootDir>` string token to include the path to your project's root directory to prevent it from accidentally ignoring all of your files in different environments that may have different root directories. Example: `["<rootDir>/build/", "<rootDir>/node_modules/"]`.

### `coverageProvider` \[string]

Indicates which provider should be used to instrument code for coverage. Allowed values are `babel` (default) or `v8`.
Expand Down
4 changes: 2 additions & 2 deletions website/versioned_docs/version-28.0/Troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,9 @@ If you use GitHub Actions, you can use [`github-actions-cpu-cores`](https://gith

Another thing you can do is use the [`shard`](CLI.md#--shard) flag to parallelize the test run across multiple machines.

## `coveragePathIgnorePatterns` seems to not have any effect.
## Negated glob patterns in the `collectCoverageFrom` list seem to not have any effect.

Make sure you are not using the `babel-plugin-istanbul` plugin. Jest wraps Istanbul, and therefore also tells Istanbul what files to instrument with coverage collection. When using `babel-plugin-istanbul`, every file that is processed by Babel will have coverage collection code, hence it is not being ignored by `coveragePathIgnorePatterns`.
Make sure you are not using the `babel-plugin-istanbul` plugin. Jest wraps Istanbul, and therefore also tells Istanbul what files to instrument with coverage collection. When using `babel-plugin-istanbul`, every file that is processed by Babel will have coverage collection code, hence it is not being ignored by the negated glob patterns in the `collectCoverageFrom` list.

## Defining Tests

Expand Down
1 change: 0 additions & 1 deletion website/versioned_docs/version-28.0/WatchPlugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ For stability and safety reasons, only part of the global configuration keys can
- [`changedSince`](cli#--changedsince)
- [`collectCoverage`](configuration#collectcoverage-boolean)
- [`collectCoverageFrom`](configuration#collectcoveragefrom-array)
- [`collectCoverageOnlyFrom`](configuration#collectcoverageonlyfrom-array)
- [`coverageDirectory`](configuration#coveragedirectory-string)
- [`coverageReporters`](configuration#coveragereporters-arraystring)
- [`notify`](configuration#notify-boolean)
Expand Down
8 changes: 0 additions & 8 deletions website/versioned_docs/version-28.1/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,14 +222,6 @@ Default: `undefined`

The directory where Jest should output its coverage files.

### `coveragePathIgnorePatterns` \[array&lt;string&gt;]

Default: `["/node_modules/"]`

An array of regexp pattern strings that are matched against all file paths before executing the test. If the file path matches any of the patterns, coverage information will be skipped.

These pattern strings match against the full path. Use the `<rootDir>` string token to include the path to your project's root directory to prevent it from accidentally ignoring all of your files in different environments that may have different root directories. Example: `["<rootDir>/build/", "<rootDir>/node_modules/"]`.

### `coverageProvider` \[string]

Indicates which provider should be used to instrument code for coverage. Allowed values are `babel` (default) or `v8`.
Expand Down
4 changes: 2 additions & 2 deletions website/versioned_docs/version-28.1/Troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,9 @@ If you use GitHub Actions, you can use [`github-actions-cpu-cores`](https://gith

Another thing you can do is use the [`shard`](CLI.md#--shard) flag to parallelize the test run across multiple machines.

## `coveragePathIgnorePatterns` seems to not have any effect.
## Negated glob patterns in the `collectCoverageFrom` list seem to not have any effect.

Make sure you are not using the `babel-plugin-istanbul` plugin. Jest wraps Istanbul, and therefore also tells Istanbul what files to instrument with coverage collection. When using `babel-plugin-istanbul`, every file that is processed by Babel will have coverage collection code, hence it is not being ignored by `coveragePathIgnorePatterns`.
Make sure you are not using the `babel-plugin-istanbul` plugin. Jest wraps Istanbul, and therefore also tells Istanbul what files to instrument with coverage collection. When using `babel-plugin-istanbul`, every file that is processed by Babel will have coverage collection code, hence it is not being ignored by the negated glob patterns in the `collectCoverageFrom` list.

## Defining Tests

Expand Down
1 change: 0 additions & 1 deletion website/versioned_docs/version-28.1/WatchPlugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ For stability and safety reasons, only part of the global configuration keys can
- [`changedSince`](cli#--changedsince)
- [`collectCoverage`](configuration#collectcoverage-boolean)
- [`collectCoverageFrom`](configuration#collectcoveragefrom-array)
- [`collectCoverageOnlyFrom`](configuration#collectcoverageonlyfrom-array)
- [`coverageDirectory`](configuration#coveragedirectory-string)
- [`coverageReporters`](configuration#coveragereporters-arraystring)
- [`notify`](configuration#notify-boolean)
Expand Down