Skip to content

Test coverage issue with Storybook 8.3.4 #29280

Answered by yannbf
tol-is asked this question in Help
Discussion options

You must be logged in to vote

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…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@gavhuang
Comment options

@gavhuang
Comment options

Answer selected by yannbf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
4 participants