From f14e29a5253a55f9c57819ed743ec65eede147a6 Mon Sep 17 00:00:00 2001 From: Spenser Black Date: Wed, 11 May 2022 16:29:10 -0400 Subject: [PATCH 1/4] Document rules for ignoring lines Documents how to ignore lines for coverage statistics, and the differences between providers. --- CHANGELOG.md | 1 + docs/Configuration.md | 8 ++++++++ website/versioned_docs/version-25.x/Configuration.md | 8 ++++++++ website/versioned_docs/version-26.x/Configuration.md | 8 ++++++++ website/versioned_docs/version-27.x/Configuration.md | 8 ++++++++ website/versioned_docs/version-28.0/Configuration.md | 8 ++++++++ website/versioned_docs/version-28.1/Configuration.md | 8 ++++++++ 7 files changed, 49 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0703930b8a15..c9490142c8dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/docs/Configuration.md b/docs/Configuration.md index e621ac7eaf42..22d524b97fe4 100644 --- a/docs/Configuration.md +++ b/docs/Configuration.md @@ -228,6 +228,14 @@ 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 different comments to exclude code from the coverage reports. When using the `babel` coverage provider, you can use comments in the format `/* istanbul ignore [non-word] [optional-docs] /*`. The simplest ignore comment is `/* istanbul ignore next */`. More information can be found [here](https://github.com/gotwarlost/istanbul/blob/f17cb56fa8664c129b497ce86c22a922a6d64d12/ignoring-code-for-coverage.md). + +The `v8` coverage provider uses c8 comments in the format `/* c8 ignore /*`. For example, `/* c8 ignore next */`. For more details, you can view 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"]` diff --git a/website/versioned_docs/version-25.x/Configuration.md b/website/versioned_docs/version-25.x/Configuration.md index 546b74d6ebac..7184eb11c170 100644 --- a/website/versioned_docs/version-25.x/Configuration.md +++ b/website/versioned_docs/version-25.x/Configuration.md @@ -215,6 +215,14 @@ 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 different comments to exclude code from the coverage reports. When using the `babel` coverage provider, you can use comments in the format `/* istanbul ignore [non-word] [optional-docs] /*`. The simplest ignore comment is `/* istanbul ignore next */`. More information can be found [here](https://github.com/gotwarlost/istanbul/blob/f17cb56fa8664c129b497ce86c22a922a6d64d12/ignoring-code-for-coverage.md). + +The `v8` coverage provider uses c8 comments in the format `/* c8 ignore /*`. For example, `/* c8 ignore next */`. For more details, you can view 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"]` diff --git a/website/versioned_docs/version-26.x/Configuration.md b/website/versioned_docs/version-26.x/Configuration.md index b3e3fa0a8551..3e83b3ab7e02 100644 --- a/website/versioned_docs/version-26.x/Configuration.md +++ b/website/versioned_docs/version-26.x/Configuration.md @@ -216,6 +216,14 @@ 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 different comments to exclude code from the coverage reports. When using the `babel` coverage provider, you can use comments in the format `/* istanbul ignore [non-word] [optional-docs] /*`. The simplest ignore comment is `/* istanbul ignore next */`. More information can be found [here](https://github.com/gotwarlost/istanbul/blob/f17cb56fa8664c129b497ce86c22a922a6d64d12/ignoring-code-for-coverage.md). + +The `v8` coverage provider uses c8 comments in the format `/* c8 ignore /*`. For example, `/* c8 ignore next */`. For more details, you can view 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"]` diff --git a/website/versioned_docs/version-27.x/Configuration.md b/website/versioned_docs/version-27.x/Configuration.md index 87d27057f420..fe154d146279 100644 --- a/website/versioned_docs/version-27.x/Configuration.md +++ b/website/versioned_docs/version-27.x/Configuration.md @@ -216,6 +216,14 @@ 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 different comments to exclude code from the coverage reports. When using the `babel` coverage provider, you can use comments in the format `/* istanbul ignore [non-word] [optional-docs] /*`. The simplest ignore comment is `/* istanbul ignore next */`. More information can be found [here](https://github.com/gotwarlost/istanbul/blob/f17cb56fa8664c129b497ce86c22a922a6d64d12/ignoring-code-for-coverage.md). + +The `v8` coverage provider uses c8 comments in the format `/* c8 ignore /*`. For example, `/* c8 ignore next */`. For more details, you can view 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"]` diff --git a/website/versioned_docs/version-28.0/Configuration.md b/website/versioned_docs/version-28.0/Configuration.md index 549cdae15fb3..051af0535af0 100644 --- a/website/versioned_docs/version-28.0/Configuration.md +++ b/website/versioned_docs/version-28.0/Configuration.md @@ -228,6 +228,14 @@ 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 different comments to exclude code from the coverage reports. When using the `babel` coverage provider, you can use comments in the format `/* istanbul ignore [non-word] [optional-docs] /*`. The simplest ignore comment is `/* istanbul ignore next */`. More information can be found [here](https://github.com/gotwarlost/istanbul/blob/f17cb56fa8664c129b497ce86c22a922a6d64d12/ignoring-code-for-coverage.md). + +The `v8` coverage provider uses c8 comments in the format `/* c8 ignore /*`. For example, `/* c8 ignore next */`. For more details, you can view 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"]` diff --git a/website/versioned_docs/version-28.1/Configuration.md b/website/versioned_docs/version-28.1/Configuration.md index e621ac7eaf42..22d524b97fe4 100644 --- a/website/versioned_docs/version-28.1/Configuration.md +++ b/website/versioned_docs/version-28.1/Configuration.md @@ -228,6 +228,14 @@ 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 different comments to exclude code from the coverage reports. When using the `babel` coverage provider, you can use comments in the format `/* istanbul ignore [non-word] [optional-docs] /*`. The simplest ignore comment is `/* istanbul ignore next */`. More information can be found [here](https://github.com/gotwarlost/istanbul/blob/f17cb56fa8664c129b497ce86c22a922a6d64d12/ignoring-code-for-coverage.md). + +The `v8` coverage provider uses c8 comments in the format `/* c8 ignore /*`. For example, `/* c8 ignore next */`. For more details, you can view 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"]` From 6d5f94da1383af36eb10d37cf83e45dffd517336 Mon Sep 17 00:00:00 2001 From: Spenser Black Date: Wed, 11 May 2022 19:26:05 -0400 Subject: [PATCH 2/4] Simplify wording of babel/c8 notes --- docs/Configuration.md | 4 +--- website/versioned_docs/version-25.x/Configuration.md | 4 +--- website/versioned_docs/version-26.x/Configuration.md | 4 +--- website/versioned_docs/version-27.x/Configuration.md | 4 +--- website/versioned_docs/version-28.0/Configuration.md | 4 +--- website/versioned_docs/version-28.1/Configuration.md | 4 +--- 6 files changed, 6 insertions(+), 18 deletions(-) diff --git a/docs/Configuration.md b/docs/Configuration.md index 22d524b97fe4..8cf5759da775 100644 --- a/docs/Configuration.md +++ b/docs/Configuration.md @@ -230,9 +230,7 @@ Note that using `v8` is considered experimental. This uses V8's builtin code cov :::note -The `babel` and `v8` coverage providers use different comments to exclude code from the coverage reports. When using the `babel` coverage provider, you can use comments in the format `/* istanbul ignore [non-word] [optional-docs] /*`. The simplest ignore comment is `/* istanbul ignore next */`. More information can be found [here](https://github.com/gotwarlost/istanbul/blob/f17cb56fa8664c129b497ce86c22a922a6d64d12/ignoring-code-for-coverage.md). - -The `v8` coverage provider uses c8 comments in the format `/* c8 ignore /*`. For example, `/* c8 ignore next */`. For more details, you can view the [c8 documentation](https://github.com/bcoe/c8/blob/49c45b3395e3354c2463cf40247c6c8eab4bbe1c/README.md#ignoring-uncovered-lines-functions-and-blocks). +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). ::: diff --git a/website/versioned_docs/version-25.x/Configuration.md b/website/versioned_docs/version-25.x/Configuration.md index 7184eb11c170..732ca79302d1 100644 --- a/website/versioned_docs/version-25.x/Configuration.md +++ b/website/versioned_docs/version-25.x/Configuration.md @@ -217,9 +217,7 @@ Note that using `v8` is considered experimental. This uses V8's builtin code cov :::note -The `babel` and `v8` coverage providers use different comments to exclude code from the coverage reports. When using the `babel` coverage provider, you can use comments in the format `/* istanbul ignore [non-word] [optional-docs] /*`. The simplest ignore comment is `/* istanbul ignore next */`. More information can be found [here](https://github.com/gotwarlost/istanbul/blob/f17cb56fa8664c129b497ce86c22a922a6d64d12/ignoring-code-for-coverage.md). - -The `v8` coverage provider uses c8 comments in the format `/* c8 ignore /*`. For example, `/* c8 ignore next */`. For more details, you can view the [c8 documentation](https://github.com/bcoe/c8/blob/49c45b3395e3354c2463cf40247c6c8eab4bbe1c/README.md#ignoring-uncovered-lines-functions-and-blocks). +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). ::: diff --git a/website/versioned_docs/version-26.x/Configuration.md b/website/versioned_docs/version-26.x/Configuration.md index 3e83b3ab7e02..1c53ee8d550d 100644 --- a/website/versioned_docs/version-26.x/Configuration.md +++ b/website/versioned_docs/version-26.x/Configuration.md @@ -218,9 +218,7 @@ Note that using `v8` is considered experimental. This uses V8's builtin code cov :::note -The `babel` and `v8` coverage providers use different comments to exclude code from the coverage reports. When using the `babel` coverage provider, you can use comments in the format `/* istanbul ignore [non-word] [optional-docs] /*`. The simplest ignore comment is `/* istanbul ignore next */`. More information can be found [here](https://github.com/gotwarlost/istanbul/blob/f17cb56fa8664c129b497ce86c22a922a6d64d12/ignoring-code-for-coverage.md). - -The `v8` coverage provider uses c8 comments in the format `/* c8 ignore /*`. For example, `/* c8 ignore next */`. For more details, you can view the [c8 documentation](https://github.com/bcoe/c8/blob/49c45b3395e3354c2463cf40247c6c8eab4bbe1c/README.md#ignoring-uncovered-lines-functions-and-blocks). +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). ::: diff --git a/website/versioned_docs/version-27.x/Configuration.md b/website/versioned_docs/version-27.x/Configuration.md index fe154d146279..1ff1a8ef6313 100644 --- a/website/versioned_docs/version-27.x/Configuration.md +++ b/website/versioned_docs/version-27.x/Configuration.md @@ -218,9 +218,7 @@ Note that using `v8` is considered experimental. This uses V8's builtin code cov :::note -The `babel` and `v8` coverage providers use different comments to exclude code from the coverage reports. When using the `babel` coverage provider, you can use comments in the format `/* istanbul ignore [non-word] [optional-docs] /*`. The simplest ignore comment is `/* istanbul ignore next */`. More information can be found [here](https://github.com/gotwarlost/istanbul/blob/f17cb56fa8664c129b497ce86c22a922a6d64d12/ignoring-code-for-coverage.md). - -The `v8` coverage provider uses c8 comments in the format `/* c8 ignore /*`. For example, `/* c8 ignore next */`. For more details, you can view the [c8 documentation](https://github.com/bcoe/c8/blob/49c45b3395e3354c2463cf40247c6c8eab4bbe1c/README.md#ignoring-uncovered-lines-functions-and-blocks). +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). ::: diff --git a/website/versioned_docs/version-28.0/Configuration.md b/website/versioned_docs/version-28.0/Configuration.md index 051af0535af0..62db0adb67d8 100644 --- a/website/versioned_docs/version-28.0/Configuration.md +++ b/website/versioned_docs/version-28.0/Configuration.md @@ -230,9 +230,7 @@ Note that using `v8` is considered experimental. This uses V8's builtin code cov :::note -The `babel` and `v8` coverage providers use different comments to exclude code from the coverage reports. When using the `babel` coverage provider, you can use comments in the format `/* istanbul ignore [non-word] [optional-docs] /*`. The simplest ignore comment is `/* istanbul ignore next */`. More information can be found [here](https://github.com/gotwarlost/istanbul/blob/f17cb56fa8664c129b497ce86c22a922a6d64d12/ignoring-code-for-coverage.md). - -The `v8` coverage provider uses c8 comments in the format `/* c8 ignore /*`. For example, `/* c8 ignore next */`. For more details, you can view the [c8 documentation](https://github.com/bcoe/c8/blob/49c45b3395e3354c2463cf40247c6c8eab4bbe1c/README.md#ignoring-uncovered-lines-functions-and-blocks). +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). ::: diff --git a/website/versioned_docs/version-28.1/Configuration.md b/website/versioned_docs/version-28.1/Configuration.md index 22d524b97fe4..8cf5759da775 100644 --- a/website/versioned_docs/version-28.1/Configuration.md +++ b/website/versioned_docs/version-28.1/Configuration.md @@ -230,9 +230,7 @@ Note that using `v8` is considered experimental. This uses V8's builtin code cov :::note -The `babel` and `v8` coverage providers use different comments to exclude code from the coverage reports. When using the `babel` coverage provider, you can use comments in the format `/* istanbul ignore [non-word] [optional-docs] /*`. The simplest ignore comment is `/* istanbul ignore next */`. More information can be found [here](https://github.com/gotwarlost/istanbul/blob/f17cb56fa8664c129b497ce86c22a922a6d64d12/ignoring-code-for-coverage.md). - -The `v8` coverage provider uses c8 comments in the format `/* c8 ignore /*`. For example, `/* c8 ignore next */`. For more details, you can view the [c8 documentation](https://github.com/bcoe/c8/blob/49c45b3395e3354c2463cf40247c6c8eab4bbe1c/README.md#ignoring-uncovered-lines-functions-and-blocks). +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). ::: From da6ee1bcd91f090e7c9dc11c02acbde0c22a140b Mon Sep 17 00:00:00 2001 From: Spenser Black Date: Thu, 12 May 2022 08:35:39 -0400 Subject: [PATCH 3/4] Update wording of ignore comment note Co-authored-by: Tom Mrazauskas --- docs/Configuration.md | 2 +- website/versioned_docs/version-25.x/Configuration.md | 2 +- website/versioned_docs/version-26.x/Configuration.md | 2 +- website/versioned_docs/version-27.x/Configuration.md | 2 +- website/versioned_docs/version-28.0/Configuration.md | 2 +- website/versioned_docs/version-28.1/Configuration.md | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/Configuration.md b/docs/Configuration.md index 8cf5759da775..3bf643df30dc 100644 --- a/docs/Configuration.md +++ b/docs/Configuration.md @@ -230,7 +230,7 @@ Note that using `v8` is considered experimental. This uses V8's builtin code cov :::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). +The `babel` and `v8` coverage providers use `/* istanbul ignore next */` and `/* c8 ignore next */` comments to exclude lines from coverage reports, respectively. For more information, you can view the [`istanbuljs` documentation](https://github.com/istanbuljs/nyc#parsing-hints-ignoring-lines) and the [`c8` documentation](https://github.com/bcoe/c8#ignoring-uncovered-lines-functions-and-blocks). ::: diff --git a/website/versioned_docs/version-25.x/Configuration.md b/website/versioned_docs/version-25.x/Configuration.md index 732ca79302d1..f9693a597d6d 100644 --- a/website/versioned_docs/version-25.x/Configuration.md +++ b/website/versioned_docs/version-25.x/Configuration.md @@ -217,7 +217,7 @@ Note that using `v8` is considered experimental. This uses V8's builtin code cov :::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). +The `babel` and `v8` coverage providers use `/* istanbul ignore next */` and `/* c8 ignore next */` comments to exclude lines from coverage reports, respectively. For more information, you can view the [`istanbuljs` documentation](https://github.com/istanbuljs/nyc#parsing-hints-ignoring-lines) and the [`c8` documentation](https://github.com/bcoe/c8#ignoring-uncovered-lines-functions-and-blocks). ::: diff --git a/website/versioned_docs/version-26.x/Configuration.md b/website/versioned_docs/version-26.x/Configuration.md index 1c53ee8d550d..3de814747e9f 100644 --- a/website/versioned_docs/version-26.x/Configuration.md +++ b/website/versioned_docs/version-26.x/Configuration.md @@ -218,7 +218,7 @@ Note that using `v8` is considered experimental. This uses V8's builtin code cov :::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). +The `babel` and `v8` coverage providers use `/* istanbul ignore next */` and `/* c8 ignore next */` comments to exclude lines from coverage reports, respectively. For more information, you can view the [`istanbuljs` documentation](https://github.com/istanbuljs/nyc#parsing-hints-ignoring-lines) and the [`c8` documentation](https://github.com/bcoe/c8#ignoring-uncovered-lines-functions-and-blocks). ::: diff --git a/website/versioned_docs/version-27.x/Configuration.md b/website/versioned_docs/version-27.x/Configuration.md index 1ff1a8ef6313..fefac258cd59 100644 --- a/website/versioned_docs/version-27.x/Configuration.md +++ b/website/versioned_docs/version-27.x/Configuration.md @@ -218,7 +218,7 @@ Note that using `v8` is considered experimental. This uses V8's builtin code cov :::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). +The `babel` and `v8` coverage providers use `/* istanbul ignore next */` and `/* c8 ignore next */` comments to exclude lines from coverage reports, respectively. For more information, you can view the [`istanbuljs` documentation](https://github.com/istanbuljs/nyc#parsing-hints-ignoring-lines) and the [`c8` documentation](https://github.com/bcoe/c8#ignoring-uncovered-lines-functions-and-blocks). ::: diff --git a/website/versioned_docs/version-28.0/Configuration.md b/website/versioned_docs/version-28.0/Configuration.md index 62db0adb67d8..be5597395d3b 100644 --- a/website/versioned_docs/version-28.0/Configuration.md +++ b/website/versioned_docs/version-28.0/Configuration.md @@ -230,7 +230,7 @@ Note that using `v8` is considered experimental. This uses V8's builtin code cov :::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). +The `babel` and `v8` coverage providers use `/* istanbul ignore next */` and `/* c8 ignore next */` comments to exclude lines from coverage reports, respectively. For more information, you can view the [`istanbuljs` documentation](https://github.com/istanbuljs/nyc#parsing-hints-ignoring-lines) and the [`c8` documentation](https://github.com/bcoe/c8#ignoring-uncovered-lines-functions-and-blocks). ::: diff --git a/website/versioned_docs/version-28.1/Configuration.md b/website/versioned_docs/version-28.1/Configuration.md index 8cf5759da775..3bf643df30dc 100644 --- a/website/versioned_docs/version-28.1/Configuration.md +++ b/website/versioned_docs/version-28.1/Configuration.md @@ -230,7 +230,7 @@ Note that using `v8` is considered experimental. This uses V8's builtin code cov :::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). +The `babel` and `v8` coverage providers use `/* istanbul ignore next */` and `/* c8 ignore next */` comments to exclude lines from coverage reports, respectively. For more information, you can view the [`istanbuljs` documentation](https://github.com/istanbuljs/nyc#parsing-hints-ignoring-lines) and the [`c8` documentation](https://github.com/bcoe/c8#ignoring-uncovered-lines-functions-and-blocks). ::: From d66524b5b2058737443a0a2ec9801ac046f65fc3 Mon Sep 17 00:00:00 2001 From: Spenser Black Date: Thu, 12 May 2022 08:49:29 -0400 Subject: [PATCH 4/4] Move ignore comment note to `collectCoverage` Moves from the note from under the `coverageProvider` section to under the `collectCoverage` section. Co-authored-by: Tom Mrazauskas --- docs/Configuration.md | 14 ++++++++------ .../versioned_docs/version-25.x/Configuration.md | 14 ++++++++------ .../versioned_docs/version-26.x/Configuration.md | 14 ++++++++------ .../versioned_docs/version-27.x/Configuration.md | 14 ++++++++------ .../versioned_docs/version-28.0/Configuration.md | 14 ++++++++------ .../versioned_docs/version-28.1/Configuration.md | 14 ++++++++------ 6 files changed, 48 insertions(+), 36 deletions(-) diff --git a/docs/Configuration.md b/docs/Configuration.md index 3bf643df30dc..7d19328833d9 100644 --- a/docs/Configuration.md +++ b/docs/Configuration.md @@ -158,6 +158,14 @@ Default: `false` Indicates whether the coverage information should be collected while executing the test. Because this retrofits all executed files with coverage collection statements, it may significantly slow down your tests. +Jest ships with two coverage providers: `babel` (default) and `v8`. See the [`coverageProvider`](#coverageprovider-string) option for more details. + +:::note + +The `babel` and `v8` coverage providers use `/* istanbul ignore next */` and `/* c8 ignore next */` comments to exclude lines from coverage reports, respectively. For more information, you can view the [`istanbuljs` documentation](https://github.com/istanbuljs/nyc#parsing-hints-ignoring-lines) and the [`c8` documentation](https://github.com/bcoe/c8#ignoring-uncovered-lines-functions-and-blocks). + +::: + ### `collectCoverageFrom` \[array] Default: `undefined` @@ -228,12 +236,6 @@ 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 */` comments to exclude lines from coverage reports, respectively. For more information, you can view the [`istanbuljs` documentation](https://github.com/istanbuljs/nyc#parsing-hints-ignoring-lines) and the [`c8` documentation](https://github.com/bcoe/c8#ignoring-uncovered-lines-functions-and-blocks). - -::: - ### `coverageReporters` \[array<string | \[string, options]>] Default: `["clover", "json", "lcov", "text"]` diff --git a/website/versioned_docs/version-25.x/Configuration.md b/website/versioned_docs/version-25.x/Configuration.md index f9693a597d6d..30146135d932 100644 --- a/website/versioned_docs/version-25.x/Configuration.md +++ b/website/versioned_docs/version-25.x/Configuration.md @@ -141,6 +141,14 @@ Default: `false` Indicates whether the coverage information should be collected while executing the test. Because this retrofits all executed files with coverage collection statements, it may significantly slow down your tests. +Jest ships with two coverage providers: `babel` (default) and `v8`. See the [`coverageProvider`](#coverageprovider-string) option for more details. + +:::note + +The `babel` and `v8` coverage providers use `/* istanbul ignore next */` and `/* c8 ignore next */` comments to exclude lines from coverage reports, respectively. For more information, you can view the [`istanbuljs` documentation](https://github.com/istanbuljs/nyc#parsing-hints-ignoring-lines) and the [`c8` documentation](https://github.com/bcoe/c8#ignoring-uncovered-lines-functions-and-blocks). + +::: + ### `collectCoverageFrom` \[array] Default: `undefined` @@ -215,12 +223,6 @@ 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 */` comments to exclude lines from coverage reports, respectively. For more information, you can view the [`istanbuljs` documentation](https://github.com/istanbuljs/nyc#parsing-hints-ignoring-lines) and the [`c8` documentation](https://github.com/bcoe/c8#ignoring-uncovered-lines-functions-and-blocks). - -::: - ### `coverageReporters` \[array<string | \[string, options]>] Default: `["clover", "json", "lcov", "text"]` diff --git a/website/versioned_docs/version-26.x/Configuration.md b/website/versioned_docs/version-26.x/Configuration.md index 3de814747e9f..cf20a5ae01ee 100644 --- a/website/versioned_docs/version-26.x/Configuration.md +++ b/website/versioned_docs/version-26.x/Configuration.md @@ -154,6 +154,14 @@ Default: `false` Indicates whether the coverage information should be collected while executing the test. Because this retrofits all executed files with coverage collection statements, it may significantly slow down your tests. +Jest ships with two coverage providers: `babel` (default) and `v8`. See the [`coverageProvider`](#coverageprovider-string) option for more details. + +:::note + +The `babel` and `v8` coverage providers use `/* istanbul ignore next */` and `/* c8 ignore next */` comments to exclude lines from coverage reports, respectively. For more information, you can view the [`istanbuljs` documentation](https://github.com/istanbuljs/nyc#parsing-hints-ignoring-lines) and the [`c8` documentation](https://github.com/bcoe/c8#ignoring-uncovered-lines-functions-and-blocks). + +::: + ### `collectCoverageFrom` \[array] Default: `undefined` @@ -216,12 +224,6 @@ 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 */` comments to exclude lines from coverage reports, respectively. For more information, you can view the [`istanbuljs` documentation](https://github.com/istanbuljs/nyc#parsing-hints-ignoring-lines) and the [`c8` documentation](https://github.com/bcoe/c8#ignoring-uncovered-lines-functions-and-blocks). - -::: - ### `coverageReporters` \[array<string | \[string, options]>] Default: `["clover", "json", "lcov", "text"]` diff --git a/website/versioned_docs/version-27.x/Configuration.md b/website/versioned_docs/version-27.x/Configuration.md index fefac258cd59..6f193a1120b9 100644 --- a/website/versioned_docs/version-27.x/Configuration.md +++ b/website/versioned_docs/version-27.x/Configuration.md @@ -154,6 +154,14 @@ Default: `false` Indicates whether the coverage information should be collected while executing the test. Because this retrofits all executed files with coverage collection statements, it may significantly slow down your tests. +Jest ships with two coverage providers: `babel` (default) and `v8`. See the [`coverageProvider`](#coverageprovider-string) option for more details. + +:::note + +The `babel` and `v8` coverage providers use `/* istanbul ignore next */` and `/* c8 ignore next */` comments to exclude lines from coverage reports, respectively. For more information, you can view the [`istanbuljs` documentation](https://github.com/istanbuljs/nyc#parsing-hints-ignoring-lines) and the [`c8` documentation](https://github.com/bcoe/c8#ignoring-uncovered-lines-functions-and-blocks). + +::: + ### `collectCoverageFrom` \[array] Default: `undefined` @@ -216,12 +224,6 @@ 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 */` comments to exclude lines from coverage reports, respectively. For more information, you can view the [`istanbuljs` documentation](https://github.com/istanbuljs/nyc#parsing-hints-ignoring-lines) and the [`c8` documentation](https://github.com/bcoe/c8#ignoring-uncovered-lines-functions-and-blocks). - -::: - ### `coverageReporters` \[array<string | \[string, options]>] Default: `["clover", "json", "lcov", "text"]` diff --git a/website/versioned_docs/version-28.0/Configuration.md b/website/versioned_docs/version-28.0/Configuration.md index be5597395d3b..eefccaab7fac 100644 --- a/website/versioned_docs/version-28.0/Configuration.md +++ b/website/versioned_docs/version-28.0/Configuration.md @@ -158,6 +158,14 @@ Default: `false` Indicates whether the coverage information should be collected while executing the test. Because this retrofits all executed files with coverage collection statements, it may significantly slow down your tests. +Jest ships with two coverage providers: `babel` (default) and `v8`. See the [`coverageProvider`](#coverageprovider-string) option for more details. + +:::note + +The `babel` and `v8` coverage providers use `/* istanbul ignore next */` and `/* c8 ignore next */` comments to exclude lines from coverage reports, respectively. For more information, you can view the [`istanbuljs` documentation](https://github.com/istanbuljs/nyc#parsing-hints-ignoring-lines) and the [`c8` documentation](https://github.com/bcoe/c8#ignoring-uncovered-lines-functions-and-blocks). + +::: + ### `collectCoverageFrom` \[array] Default: `undefined` @@ -228,12 +236,6 @@ 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 */` comments to exclude lines from coverage reports, respectively. For more information, you can view the [`istanbuljs` documentation](https://github.com/istanbuljs/nyc#parsing-hints-ignoring-lines) and the [`c8` documentation](https://github.com/bcoe/c8#ignoring-uncovered-lines-functions-and-blocks). - -::: - ### `coverageReporters` \[array<string | \[string, options]>] Default: `["clover", "json", "lcov", "text"]` diff --git a/website/versioned_docs/version-28.1/Configuration.md b/website/versioned_docs/version-28.1/Configuration.md index 3bf643df30dc..7d19328833d9 100644 --- a/website/versioned_docs/version-28.1/Configuration.md +++ b/website/versioned_docs/version-28.1/Configuration.md @@ -158,6 +158,14 @@ Default: `false` Indicates whether the coverage information should be collected while executing the test. Because this retrofits all executed files with coverage collection statements, it may significantly slow down your tests. +Jest ships with two coverage providers: `babel` (default) and `v8`. See the [`coverageProvider`](#coverageprovider-string) option for more details. + +:::note + +The `babel` and `v8` coverage providers use `/* istanbul ignore next */` and `/* c8 ignore next */` comments to exclude lines from coverage reports, respectively. For more information, you can view the [`istanbuljs` documentation](https://github.com/istanbuljs/nyc#parsing-hints-ignoring-lines) and the [`c8` documentation](https://github.com/bcoe/c8#ignoring-uncovered-lines-functions-and-blocks). + +::: + ### `collectCoverageFrom` \[array] Default: `undefined` @@ -228,12 +236,6 @@ 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 */` comments to exclude lines from coverage reports, respectively. For more information, you can view the [`istanbuljs` documentation](https://github.com/istanbuljs/nyc#parsing-hints-ignoring-lines) and the [`c8` documentation](https://github.com/bcoe/c8#ignoring-uncovered-lines-functions-and-blocks). - -::: - ### `coverageReporters` \[array<string | \[string, options]>] Default: `["clover", "json", "lcov", "text"]`