Open
Description
Describe the bug
I have some stories I want to exclude from coverage.
So I have this config:
const config = {
addons: [{
name: '@storybook/addon-coverage',
options: {
istanbul: {
exclude: ["**/Button*"] // <-- here
}
}
}]
}
When running test-storybook --coverage
,
those stories failed with:
[Test runner] An error occurred when evaluating code coverage:
The code in this story is not instrumented, which means the coverage setup is likely not correct.
More info: https://github.com/storybookjs/test-runner#setting-up-code-coverage
Steps to reproduce the behavior
https://github.com/cyberuni/storybook-coverage-instrument-issue
pnpm i
pnpm storybook
pnpm test-storybook --coverage # another terminal
Expected behavior
Those stories should be excluded from the coverage and should not fail.
Screenshots and/or logs
Environment
- OS: Windows 11
- Node.js version: v18.12.1
- PNPM version: 7.18.0