diff --git a/docs/Configuration.md b/docs/Configuration.md index 384e60723092..9916661b11b2 100644 --- a/docs/Configuration.md +++ b/docs/Configuration.md @@ -220,21 +220,25 @@ 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. -### `coverageReporters` \[array<string *| \[*string, options]>] +### `coverageReporters` \[array<string | [string, options]>] -Default: `["json", "lcov", "text", "clover"]` +Default: `["clover", "json", "lcov", "text"]` A list of reporter names that Jest uses when writing coverage reports. Any [istanbul reporter](https://github.com/istanbuljs/istanbuljs/tree/master/packages/istanbul-reports/lib) can be used. _Note: Setting this option overwrites the default values. Add `"text"` or `"text-summary"` to see a coverage summary in the console output._ -_Note: You can pass additional options to the istanbul reporter using the tuple form. For example:_ +Additional options can be passed using the tuple form. For example, you may hide coverage report lines for all fully-covered files: ```json -["json", ["lcov", {"projectRoot": "../../"}]] +{ + "coverageReporters": [ + "clover", "json", "lcov", ["text", {"skipFull": true}] + ] +} ``` -For the additional information about the options object shape you can refer to `CoverageReporterWithOptions` type in the [type definitions](https://github.com/facebook/jest/tree/main/packages/jest-types/src/Config.ts). +For more information about the options object shape refer to `CoverageReporterWithOptions` type in the [type definitions](https://github.com/facebook/jest/tree/main/packages/jest-types/src/Config.ts). ### `coverageThreshold` \[object] diff --git a/website/versioned_docs/version-25.x/Configuration.md b/website/versioned_docs/version-25.x/Configuration.md index cf2b740ef0bb..34106cc4bbb6 100644 --- a/website/versioned_docs/version-25.x/Configuration.md +++ b/website/versioned_docs/version-25.x/Configuration.md @@ -202,21 +202,25 @@ 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 -### `coverageReporters` \[array<string | \[string, options]>] +### `coverageReporters` \[array<string | [string, options]>] -Default: `["json", "lcov", "text", "clover"]` +Default: `["clover", "json", "lcov", "text"]` A list of reporter names that Jest uses when writing coverage reports. Any [istanbul reporter](https://github.com/istanbuljs/istanbuljs/tree/master/packages/istanbul-reports/lib) can be used. _Note: Setting this option overwrites the default values. Add `"text"` or `"text-summary"` to see a coverage summary in the console output._ -_Note: You can pass additional options to the istanbul reporter using the tuple form. For example:_ +Additional options can be passed using the tuple form. For example, you may hide coverage report lines for all fully-covered files: ```json -["json", ["lcov", {"projectRoot": "../../"}]] +{ + "coverageReporters": [ + "clover", "json", "lcov", ["text", {"skipFull": true}] + ] +} ``` -For the additional information about the options object shape you can refer to `CoverageReporterWithOptions` type in the [type definitions](https://github.com/facebook/jest/tree/main/packages/jest-types/src/Config.ts). +For more information about the options object shape refer to `CoverageReporterWithOptions` type in the [type definitions](https://github.com/facebook/jest/tree/main/packages/jest-types/src/Config.ts). ### `coverageThreshold` \[object] diff --git a/website/versioned_docs/version-26.x/Configuration.md b/website/versioned_docs/version-26.x/Configuration.md index d05695252606..eac16d218976 100644 --- a/website/versioned_docs/version-26.x/Configuration.md +++ b/website/versioned_docs/version-26.x/Configuration.md @@ -220,21 +220,25 @@ 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. -### `coverageReporters` \[array<string | \[string, options]>] +### `coverageReporters` \[array<string | [string, options]>] -Default: `["json", "lcov", "text", "clover"]` +Default: `["clover", "json", "lcov", "text"]` A list of reporter names that Jest uses when writing coverage reports. Any [istanbul reporter](https://github.com/istanbuljs/istanbuljs/tree/master/packages/istanbul-reports/lib) can be used. _Note: Setting this option overwrites the default values. Add `"text"` or `"text-summary"` to see a coverage summary in the console output._ -_Note: You can pass additional options to the istanbul reporter using the tuple form. For example:_ +Additional options can be passed using the tuple form. For example, you may hide coverage report lines for all fully-covered files: ```json -["json", ["lcov", {"projectRoot": "../../"}]] +{ + "coverageReporters": [ + "clover", "json", "lcov", ["text", {"skipFull": true}] + ] +} ``` -For the additional information about the options object shape you can refer to `CoverageReporterWithOptions` type in the [type definitions](https://github.com/facebook/jest/tree/main/packages/jest-types/src/Config.ts). +For more information about the options object shape refer to `CoverageReporterWithOptions` type in the [type definitions](https://github.com/facebook/jest/tree/main/packages/jest-types/src/Config.ts). ### `coverageThreshold` \[object] diff --git a/website/versioned_docs/version-27.0/Configuration.md b/website/versioned_docs/version-27.0/Configuration.md index 5c8fb451b8f7..6e51625a429f 100644 --- a/website/versioned_docs/version-27.0/Configuration.md +++ b/website/versioned_docs/version-27.0/Configuration.md @@ -220,21 +220,25 @@ 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. -### `coverageReporters` \[array<string *| \[*string, options]>] +### `coverageReporters` \[array<string | [string, options]>] -Default: `["json", "lcov", "text", "clover"]` +Default: `["clover", "json", "lcov", "text"]` A list of reporter names that Jest uses when writing coverage reports. Any [istanbul reporter](https://github.com/istanbuljs/istanbuljs/tree/master/packages/istanbul-reports/lib) can be used. _Note: Setting this option overwrites the default values. Add `"text"` or `"text-summary"` to see a coverage summary in the console output._ -_Note: You can pass additional options to the istanbul reporter using the tuple form. For example:_ +Additional options can be passed using the tuple form. For example, you may hide coverage report lines for all fully-covered files: ```json -["json", ["lcov", {"projectRoot": "../../"}]] +{ + "coverageReporters": [ + "clover", "json", "lcov", ["text", {"skipFull": true}] + ] +} ``` -For the additional information about the options object shape you can refer to `CoverageReporterWithOptions` type in the [type definitions](https://github.com/facebook/jest/tree/main/packages/jest-types/src/Config.ts). +For more information about the options object shape refer to `CoverageReporterWithOptions` type in the [type definitions](https://github.com/facebook/jest/tree/main/packages/jest-types/src/Config.ts). ### `coverageThreshold` \[object] diff --git a/website/versioned_docs/version-27.1/Configuration.md b/website/versioned_docs/version-27.1/Configuration.md index de70e3cdbebd..91c466b4f483 100644 --- a/website/versioned_docs/version-27.1/Configuration.md +++ b/website/versioned_docs/version-27.1/Configuration.md @@ -220,21 +220,26 @@ 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. -### `coverageReporters` \[array<string *| \[*string, options]>] -Default: `["json", "lcov", "text", "clover"]` +### `coverageReporters` \[array<string | [string, options]>] + +Default: `["clover", "json", "lcov", "text"]` A list of reporter names that Jest uses when writing coverage reports. Any [istanbul reporter](https://github.com/istanbuljs/istanbuljs/tree/master/packages/istanbul-reports/lib) can be used. _Note: Setting this option overwrites the default values. Add `"text"` or `"text-summary"` to see a coverage summary in the console output._ -_Note: You can pass additional options to the istanbul reporter using the tuple form. For example:_ +Additional options can be passed using the tuple form. For example, you may hide coverage report lines for all fully-covered files: ```json -["json", ["lcov", {"projectRoot": "../../"}]] +{ + "coverageReporters": [ + "clover", "json", "lcov", ["text", {"skipFull": true}] + ] +} ``` -For the additional information about the options object shape you can refer to `CoverageReporterWithOptions` type in the [type definitions](https://github.com/facebook/jest/tree/main/packages/jest-types/src/Config.ts). +For more information about the options object shape refer to `CoverageReporterWithOptions` type in the [type definitions](https://github.com/facebook/jest/tree/main/packages/jest-types/src/Config.ts). ### `coverageThreshold` \[object] diff --git a/website/versioned_docs/version-27.2/Configuration.md b/website/versioned_docs/version-27.2/Configuration.md index 384e60723092..9916661b11b2 100644 --- a/website/versioned_docs/version-27.2/Configuration.md +++ b/website/versioned_docs/version-27.2/Configuration.md @@ -220,21 +220,25 @@ 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. -### `coverageReporters` \[array<string *| \[*string, options]>] +### `coverageReporters` \[array<string | [string, options]>] -Default: `["json", "lcov", "text", "clover"]` +Default: `["clover", "json", "lcov", "text"]` A list of reporter names that Jest uses when writing coverage reports. Any [istanbul reporter](https://github.com/istanbuljs/istanbuljs/tree/master/packages/istanbul-reports/lib) can be used. _Note: Setting this option overwrites the default values. Add `"text"` or `"text-summary"` to see a coverage summary in the console output._ -_Note: You can pass additional options to the istanbul reporter using the tuple form. For example:_ +Additional options can be passed using the tuple form. For example, you may hide coverage report lines for all fully-covered files: ```json -["json", ["lcov", {"projectRoot": "../../"}]] +{ + "coverageReporters": [ + "clover", "json", "lcov", ["text", {"skipFull": true}] + ] +} ``` -For the additional information about the options object shape you can refer to `CoverageReporterWithOptions` type in the [type definitions](https://github.com/facebook/jest/tree/main/packages/jest-types/src/Config.ts). +For more information about the options object shape refer to `CoverageReporterWithOptions` type in the [type definitions](https://github.com/facebook/jest/tree/main/packages/jest-types/src/Config.ts). ### `coverageThreshold` \[object]