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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document differences in coverage ignore comments between providers #12836

Merged
merged 4 commits into from May 13, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -10,6 +10,7 @@

- `[docs]` Updated docs to indicate that `jest-environment-jsdom` is a separate package [#12828](https://github.com/facebook/jest/issues/12828)
- `[jest-haste-map]` Bump `walker` version ([#12324](https://github.com/facebook/jest/pull/12324))
- `[docs]` Document the comments used by coverage providers [#12835](https://github.com/facebook/jest/issues/12835)

### Performance

Expand Down
6 changes: 6 additions & 0 deletions docs/Configuration.md
Expand Up @@ -228,6 +228,12 @@ Indicates which provider should be used to instrument code for coverage. Allowed

Note that using `v8` is considered experimental. This uses V8's builtin code coverage rather than one based on Babel. It is not as well tested, and it has also improved in the last few releases of Node. Using the latest versions of node (v14 at the time of this writing) will yield better results.

:::note

The `babel` and `v8` coverage providers use `/* istanbul ignore next */` and `/* c8 ignore next */` to exclude lines from coverage reports, respectively. For more information, you can view [the istanbuljs documentation](https://github.com/gotwarlost/istanbul/blob/f17cb56fa8664c129b497ce86c22a922a6d64d12/ignoring-code-for-coverage.md) and [the c8 documentation](https://github.com/bcoe/c8/blob/49c45b3395e3354c2463cf40247c6c8eab4bbe1c/README.md#ignoring-uncovered-lines-functions-and-blocks).
spenserblack marked this conversation as resolved.
Show resolved Hide resolved

:::

### `coverageReporters` \[array<string | \[string, options]>]

Default: `["clover", "json", "lcov", "text"]`
Expand Down
6 changes: 6 additions & 0 deletions website/versioned_docs/version-25.x/Configuration.md
Expand Up @@ -215,6 +215,12 @@ Note that using `v8` is considered experimental. This uses V8's builtin code cov
1. Tests needs to run in Node test environment (support for `jsdom` requires [`jest-environment-jsdom-sixteen`](https://www.npmjs.com/package/jest-environment-jsdom-sixteen))
1. V8 has way better data in the later versions, so using the latest versions of node (v13 at the time of this writing) will yield better results

:::note

The `babel` and `v8` coverage providers use `/* istanbul ignore next */` and `/* c8 ignore next */` to exclude lines from coverage reports, respectively. For more information, you can view [the istanbuljs documentation](https://github.com/gotwarlost/istanbul/blob/f17cb56fa8664c129b497ce86c22a922a6d64d12/ignoring-code-for-coverage.md) and [the c8 documentation](https://github.com/bcoe/c8/blob/49c45b3395e3354c2463cf40247c6c8eab4bbe1c/README.md#ignoring-uncovered-lines-functions-and-blocks).

:::

### `coverageReporters` \[array<string | \[string, options]>]

Default: `["clover", "json", "lcov", "text"]`
Expand Down
6 changes: 6 additions & 0 deletions website/versioned_docs/version-26.x/Configuration.md
Expand Up @@ -216,6 +216,12 @@ Indicates which provider should be used to instrument code for coverage. Allowed

Note that using `v8` is considered experimental. This uses V8's builtin code coverage rather than one based on Babel. It is not as well tested, and it has also improved in the last few releases of Node. Using the latest versions of node (v14 at the time of this writing) will yield better results.

:::note

The `babel` and `v8` coverage providers use `/* istanbul ignore next */` and `/* c8 ignore next */` to exclude lines from coverage reports, respectively. For more information, you can view [the istanbuljs documentation](https://github.com/gotwarlost/istanbul/blob/f17cb56fa8664c129b497ce86c22a922a6d64d12/ignoring-code-for-coverage.md) and [the c8 documentation](https://github.com/bcoe/c8/blob/49c45b3395e3354c2463cf40247c6c8eab4bbe1c/README.md#ignoring-uncovered-lines-functions-and-blocks).

:::

### `coverageReporters` \[array<string | \[string, options]>]

Default: `["clover", "json", "lcov", "text"]`
Expand Down
6 changes: 6 additions & 0 deletions website/versioned_docs/version-27.x/Configuration.md
Expand Up @@ -216,6 +216,12 @@ Indicates which provider should be used to instrument code for coverage. Allowed

Note that using `v8` is considered experimental. This uses V8's builtin code coverage rather than one based on Babel. It is not as well tested, and it has also improved in the last few releases of Node. Using the latest versions of node (v14 at the time of this writing) will yield better results.

:::note

The `babel` and `v8` coverage providers use `/* istanbul ignore next */` and `/* c8 ignore next */` to exclude lines from coverage reports, respectively. For more information, you can view [the istanbuljs documentation](https://github.com/gotwarlost/istanbul/blob/f17cb56fa8664c129b497ce86c22a922a6d64d12/ignoring-code-for-coverage.md) and [the c8 documentation](https://github.com/bcoe/c8/blob/49c45b3395e3354c2463cf40247c6c8eab4bbe1c/README.md#ignoring-uncovered-lines-functions-and-blocks).

:::

### `coverageReporters` \[array<string | \[string, options]>]

Default: `["clover", "json", "lcov", "text"]`
Expand Down
6 changes: 6 additions & 0 deletions website/versioned_docs/version-28.0/Configuration.md
Expand Up @@ -228,6 +228,12 @@ Indicates which provider should be used to instrument code for coverage. Allowed

Note that using `v8` is considered experimental. This uses V8's builtin code coverage rather than one based on Babel. It is not as well tested, and it has also improved in the last few releases of Node. Using the latest versions of node (v14 at the time of this writing) will yield better results.

:::note

The `babel` and `v8` coverage providers use `/* istanbul ignore next */` and `/* c8 ignore next */` to exclude lines from coverage reports, respectively. For more information, you can view [the istanbuljs documentation](https://github.com/gotwarlost/istanbul/blob/f17cb56fa8664c129b497ce86c22a922a6d64d12/ignoring-code-for-coverage.md) and [the c8 documentation](https://github.com/bcoe/c8/blob/49c45b3395e3354c2463cf40247c6c8eab4bbe1c/README.md#ignoring-uncovered-lines-functions-and-blocks).

:::

### `coverageReporters` \[array<string | \[string, options]>]

Default: `["clover", "json", "lcov", "text"]`
Expand Down
6 changes: 6 additions & 0 deletions website/versioned_docs/version-28.1/Configuration.md
Expand Up @@ -228,6 +228,12 @@ Indicates which provider should be used to instrument code for coverage. Allowed

Note that using `v8` is considered experimental. This uses V8's builtin code coverage rather than one based on Babel. It is not as well tested, and it has also improved in the last few releases of Node. Using the latest versions of node (v14 at the time of this writing) will yield better results.

:::note

The `babel` and `v8` coverage providers use `/* istanbul ignore next */` and `/* c8 ignore next */` to exclude lines from coverage reports, respectively. For more information, you can view [the istanbuljs documentation](https://github.com/gotwarlost/istanbul/blob/f17cb56fa8664c129b497ce86c22a922a6d64d12/ignoring-code-for-coverage.md) and [the c8 documentation](https://github.com/bcoe/c8/blob/49c45b3395e3354c2463cf40247c6c8eab4bbe1c/README.md#ignoring-uncovered-lines-functions-and-blocks).

:::

### `coverageReporters` \[array<string | \[string, options]>]

Default: `["clover", "json", "lcov", "text"]`
Expand Down