Skip to content

Commit

Permalink
docs: add different coverage report example (#11904)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrazauskas authored Sep 28, 2021
1 parent 09f225f commit 0b2b33f
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 30 deletions.
14 changes: 9 additions & 5 deletions docs/Configuration.md
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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

0 comments on commit 0b2b33f

Please sign in to comment.