test-runner: [Bug] Empty code coverage report
Describe the bug
Hey guys, I’m attempting to setup code-coverage for storybook in my project, I’m able to get everything to run smoothy with yarn test-storybook but when I attempt to use yarn test-storybook --coverage I am getting an empty code coverage report.
I am running against a local storybook build on 6006 as well.
Test Suites: 90 passed, 90 total Tests: 114 passed, 114 total Snapshots: 0 total Time: 86.72 s, estimated 87 s Ran all test suites. Coverage file (2 bytes) written to .nyc_output/coverage.json ----------|---------|----------|---------|---------|-------------------
| File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s |
|---|---|---|---|---|---|
| All files | 0 | 0 | 0 | 0 | |
| ---------- | --------- | ---------- | --------- | --------- | ------------------- |
| ✨ Done in 111.65s. |
In addition to that I am seeing that the coverage/storybook/coverage-storybook file has no data, just an empty object.
I have also added the addon-coverage package and updated my .storybook/main.js with @storybook/addon-coverage
I’m wondering if this is a webpack config issue, but I’m not sure what might be the best way to start debugging this.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 3
- Comments: 17 (6 by maintainers)
Hey everyone, I’ll be closing this issue as it’s not really a bug.
Reason for this to happen:
@storybook/addon-coverage.@storybook/addon-coveragehowever also are manually replacingbabel-loaderfrom Storybook to do something custom for your project. This makes it so that the plugin from the addon do not get applied.If that is not the case and you’re experiencing this exact issue, feel free to reopen this!