From 8e12e9722a16567c312870fec4fd96605b300151 Mon Sep 17 00:00:00 2001 From: jonniebigodes Date: Thu, 30 Nov 2023 18:55:27 +0000 Subject: [PATCH] Docs: Test coverage add callout for configuration --- docs/writing-tests/test-coverage.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/writing-tests/test-coverage.md b/docs/writing-tests/test-coverage.md index b0df76cbf73a..79f5fe2ce8a4 100644 --- a/docs/writing-tests/test-coverage.md +++ b/docs/writing-tests/test-coverage.md @@ -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
`options: { istanbul: { checkProd: true,}}` | Vite | | `forceBuildInstrument` | Configures the plugin to add instrumentation in build mode
`options: { istanbul: { forceBuildInstrument: true,}}` | Vite | + + +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). + + + ## 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: