Open KL13NT opened 1 year ago
Hi, Nabil! @storybook/test-runner
is only ever intended to test (and therefore, provide coverage for) Storybook stories.
However, you can combine coverage from the test runner and other tools. You can find guidance in the test runner README: https://github.com/storybookjs/test-runner#3---merging-code-coverage-with-coverage-from-other-tools
If you wish to run all tests with a single command, you could set up your package scripts something like this:
"scripts": {
"test": "jest",
"test-storybook": "test-storybook",
"test:all": "yarn test && yarn test-storybook"
}
The guidance linked above includes an example for doing something similar for generating coverage reports.
Hey @kylegach , this doesn't solve the problem of having Jest report all my snapshots as obsolete. Is there a way around this?
Hey @kasperpeulen you have recently experienced with merging Storybook and non-Storybook tests in a single jest config. Do you have any ideas to help here? <3
@KL13NT @yannbf Yes, I merged them like this! https://github.com/kasperpeulen/storybook-remix/blob/main/jest-storybook.config.ts
Hi! I've successfully managed to eject my configuration and configured test-runner to execute my normal
*.test.ts
files. It works as expected, but these custom test files do not show up in coverage reports. Am I missing something?I get the following output when running
npx test-storybook --coverage
: