Skip to content

Commit

Permalink
Merge pull request storybookjs#25065 from storybookjs/docs_testing_fi…
Browse files Browse the repository at this point in the history
…x_coverage

Docs: Test coverage add callout for configuration
  • Loading branch information
jonniebigodes authored Nov 30, 2023
2 parents 4db3370 + 0aad1b4 commit a4b91ea
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/writing-tests/test-coverage.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,12 @@ By default, the [`@storybook/addon-coverage`](https://storybook.js.org/addons/@s
| `checkProd` | Configures the plugin to skip instrumentation in production environments <br/>`options: { istanbul: { checkProd: true,}}` | Vite |
| `forceBuildInstrument` | Configures the plugin to add instrumentation in build mode <br/>`options: { istanbul: { forceBuildInstrument: true,}}` | Vite |

<Callout variant="info">

Including the `nycrcPath` option enables use of an existing `nyc` configuration file with additional options like [coverage thresholds](https://github.com/istanbuljs/nyc#coverage-thresholds). For more information, refer to the [`nyc` documentation](https://github.com/istanbuljs/nyc#common-configuration-options).

</Callout>

## What about other coverage reporting tools?

Out of the box, code coverage tests work seamlessly with Storybook's test-runner and the [`@storybook/addon-coverage`](https://storybook.js.org/addons/@storybook/addon-coverage). However, that doesn't mean you can't use additional reporting tools (e.g., [Codecov](https://about.codecov.io/)). For instance, if you're working with [LCOV](https://wiki.documentfoundation.org/Development/Lcov), you can use the generated output (in `coverage/storybook/coverage-storybook.json`) and create your own report with:
Expand Down

0 comments on commit a4b91ea

Please sign in to comment.