-
SummaryI'm having an issue with the
What's strange is that the issue happens, whether i'm running tests on a build (prod or test), and on dev mode. Without the Any help would be appreciated! Additional informationNo response Create a reproduction
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
cc @yannbf |
Beta Was this translation helpful? Give feedback.
-
Hey @tol-is thanks for providing a reproduction, it makes it possible for us to assist you! In your repro, by just moving the button code into the Storybook directory, coverage works as expected. You could also take a look into configuring the coverage addon to tinker with the paths to include the sources. I'd encourage you to just colocate Storybook with your app or move it to the root of your repo though. Here's a quick way to test if coverage is working:
|
Beta Was this translation helpful? Give feedback.
Hey @tol-is thanks for providing a reproduction, it makes it possible for us to assist you!
Your issue is related to the fact that you are setting up two different packages, one for Storybook and another for your components. The istanbul instrumentation (which happens as part of the coverage addon) is then looking for files but can't find them. Generally, we do not recommend to separate Storybook and your components. This can cause different issues and is less likely to happen if you just colocate your configuration (think of Storybook like jest/vitest).
In your repro, by just moving the button code into the Storybook directory, coverage works as expected. You could also take a look into c…