Open sebaguozden opened 8 months ago
It is related to https://github.com/storybookjs/addon-coverage/issues/17. Addon is not compatible with @vitejs/plugin-react-swc. Any idea how to fix it?
I have the exact same issue but I am not using @vitejs/plugin-react-swc, I have @vitejs/plugin-react in my package.json
Checking the coverage-storybook.json
output, I find that the missing components are in my output json file but the file path is wrong. Instead of /path/to/my/Component.tsx
, they are /path/to/my/Component
. I guess that's why the nyc report cannot find them in my cases
I have the exact issue. I am using addon-coverage with @storybook/addon-webpack5-compiler-swc. My project doesn't work with babel-loader so i removed it from webpack config and custom configured to use swc-loader instead. and it returns 0 coverage on files
Describe the bug
Everything runs smoothly with
pnpm test-storybook
. On the other hand,pnpm test-storybook --coverage
returns an empty coverage report.Steps to reproduce the behavior
pnpm storybook
pnpm test-storybook --coverage
{}
Expected behavior
Show
**/*.tsx
files on the report.Screenshots and/or logs
.storybook/main.ts![image](https://github.com/storybookjs/addon-coverage/assets/31735648/b2580df3-a7c4-4491-8b6e-293d49c24a3c)
package.json![image](https://github.com/storybookjs/addon-coverage/assets/31735648/65d146be-20f2-4698-bcb3-18fc756987bb)
EMPTY Coverage (Console) Report![image](https://github.com/storybookjs/addon-coverage/assets/31735648/01ee1884-a9f0-439b-a989-bbd5d69a2542)
EMPTY Coverage (File) Report![image](https://github.com/storybookjs/addon-coverage/assets/31735648/2c230ed6-00d4-42cd-95e8-ef56f8fe8de1)
Environment
pnpm exec playwright install
+pnpm exec playwright install-deps
)