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

docs: add different coverage report example #11904

Merged
merged 1 commit into from Sep 28, 2021
Merged
Show file tree
Hide file tree
Changes from all 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
14 changes: 9 additions & 5 deletions docs/Configuration.md
Expand Up @@ -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]

Expand Down
14 changes: 9 additions & 5 deletions website/versioned_docs/version-25.x/Configuration.md
Expand Up @@ -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]

Expand Down
14 changes: 9 additions & 5 deletions website/versioned_docs/version-26.x/Configuration.md
Expand Up @@ -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]

Expand Down
14 changes: 9 additions & 5 deletions website/versioned_docs/version-27.0/Configuration.md
Expand Up @@ -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]

Expand Down
15 changes: 10 additions & 5 deletions website/versioned_docs/version-27.1/Configuration.md
Expand Up @@ -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]

Expand Down
14 changes: 9 additions & 5 deletions website/versioned_docs/version-27.2/Configuration.md
Expand Up @@ -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]

Expand Down