-
Notifications
You must be signed in to change notification settings - Fork 72
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
[Bug] Does not find svelte stories #80
Comments
Alright, I dug into this just a bit. I needed to update the
Then, my tests are picked up and attempt to run. However, it seems that the call to |
Hey @IanVS, I also gave it a quick shot and identified some improvements:
With those two changes it parses the svelte-stories successfully, but can't find any tests afterwards... So one step further but not done yet. |
The problem is that the test runner actually analyzes the AST of CSF files. Adding svelte support will just bloat the test runner and is not feasible. It's a similar problem to adding MDX support. You can find the workaround, which is to use |
Hmmmmm, I think it might be a bug, but when I use Edit: looks like it is probably due to this: https://github.com/storybookjs/storybook/blob/552b0d3f6c23486e603a304439639f69facad40d/lib/core-server/src/utils/StoryIndexGenerator.ts#L51-L54 |
My bad @IanVS -- indeed we don't generate |
No worries, I just wanted to be sure I understood what was going on. I think it would be a good idea to clearly state in the README which kinds of stories / formats the tool supports, just to avoid any confusion. |
Solution in progress here storybookjs/addon-svelte-csf#65 |
For posterity, seems like v2.0.9 of addon-svelte-csf got released containing a story indexer for .svelte stories, which means this probably works now? |
@yannbf that was accidental, and was reverted in 2.0.10. To use the story indexer, it's necessary to use storybook 7 and version 3.0.0-next.x of the addon. But yes, this can be closed out now. |
replace plain typescript storybook format with svelte using addon-svelte-csf this requires running test-storybook with --json-index flag. see: - storybookjs/addon-svelte-csf#65 - storybookjs/test-runner#80
Describe the bug
I've just added @storybook/test-runner to the storybook-builder-vite, and found that tests are not running correctly on our svelte example project. I get the following message:
This can be seen in a CI run here: https://github.com/eirslett/storybook-builder-vite/runs/5538433882?check_suite_focus=true#step:7:47
Steps to reproduce the behavior
git checkout storybook-test-ci
yarn install
cd examples/svelte
yarn build-storybook
yarn test-ci
Expected behavior
I expect that the stories are found, and tests are run correctly.
Additional context
We are using svelte component stories, maybe the test-runner does not support them? I didn't see any notes or issues about it yet, though.
The text was updated successfully, but these errors were encountered: