How to run multiple storyshots?
See original GitHub issueDescribe the bug A clear and concise description of what the bug is.
To Reproduce
- Setup several storyshot tests with initStoryShots()
- Run them and get the warning below
Expected behavior No warning
Code snippets
console.warn Unexpected loaded state. Did you call
load` twice?
4 | const storybookUrl = 'http://localhost:9000';
5 |
> 6 | initStoryshots({
| ^
7 | suite: 'A11y checks',
8 | test: axeTest({ storybookUrl }),
9 | });
` System: Environment Info:
System: OS: macOS 10.15.5 CPU: (8) x64 Intel® Core™ i7-7700HQ CPU @ 2.80GHz Binaries: Node: 14.1.0 - /usr/local/bin/node Yarn: 1.22.4 - /usr/local/bin/yarn npm: 6.14.4 - /usr/local/bin/npm Browsers: Chrome: 83.0.4103.116 Edge: 83.0.478.58 Firefox: 74.0 Safari: 13.1.1 npmPackages: @storybook/addon-a11y: ^6.0.0-beta.38 => 6.0.0-beta.39 @storybook/addon-controls: ^6.0.0-beta.15 => 6.0.0-beta.15 @storybook/addon-docs: ^6.0.0-beta.38 => 6.0.0-beta.39 @storybook/addon-jest: ^5.3.19 => 5.3.19 @storybook/addon-knobs: ^6.0.0-beta.38 => 6.0.0-beta.39 @storybook/addon-links: ^6.0.0-beta.38 => 6.0.0-beta.39 @storybook/addon-storyshots: ^6.0.0-beta.38 => 6.0.0-beta.39 @storybook/addon-storyshots-puppeteer: ^5.3.19 => 5.3.19 @storybook/addon-storysource: ^6.0.0-beta.38 => 6.0.0-beta.39 @storybook/addon-viewport: ^6.0.0-beta.38 => 6.0.0-beta.39 @storybook/preset-scss: ^1.0.2 => 1.0.2 @storybook/react: ^6.0.0-beta.38 => 6.0.0-beta.39
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (1 by maintainers)
Top GitHub Comments
I’m having the same issue currently with the latest storyshots/storybook 6.0.21
As im seeing, in order to support multiple
initStoryshots
you need to create multiple files, it treats better this way using singleinitStoryshots
per file, worked for me, not best solution but at least the error disappeared.