-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Vite -> React -> Typescript + SWC] Empty (no, 0, files found) code coverage report #28
Comments
It is related to #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 |
I have the exact issue. I am using addon-coverage with @storybook/addon-webpack5-compiler-swc. |
I think you are missing a |
Any update on this one? I also have Vite, React, TS, SWC stack and still suffer from that issue. As Test Addon for Storybook is still in experimental mode, using this |
@bartstcv If you share your scripts from your |
That's the script from {
"scripts": {
"test-storybook-coverage": "test-storybook -- --coverage --excludeTags=\"!test\""
}
} And I just do |
Try without the {
"scripts": {
"test-storybook-coverage": "test-storybook --coverage --excludeTags=\"!test\""
}
} The |
Oh, that was clumsy of mine as at first I tested it directly in the command line. Without
It acts like the config of coverage addon in And here are few more issues corelated with the problem: |
All right, it turned out it had nothing to do with
I had to add this to my Storybook config file import * as tsconfigPaths from 'vite-tsconfig-paths';
const config: StorybookConfig = {
// ...existing configuration...
async viteFinal(config) {
return {
...config,
plugins: [...(config.plugins ?? []), tsconfigPaths.default()]
};
},
// ...existing configuration...
};
export default config; I ensured that the |
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

package.json

EMPTY Coverage (Console) Report

EMPTY Coverage (File) Report

Environment
pnpm exec playwright install
+pnpm exec playwright install-deps
)The text was updated successfully, but these errors were encountered: