You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe
Currently, the setup instructions read as follows:
Create a new test file with the name Storyshots.test.js. (Or whatever the name you prefer, as long as it matches Jest's config testMatch). Then add following content to it:
import initStoryshots from '@storybook/addon-storyshots';
initStoryshots();
That's all.
Now run your Jest test command. (Usually, npm test.) Then you can see all of your stories are converted as Jest snapshot tests.
There are 2 problems I've noticed with this:
All snapshots are written to a __snapshots__/Storyshots.test.js.snap file. This can become a nightmare to review pretty quickly
As the Storyshots.test.js file is an arbitrary test file, it's not picked up by Jest if running a specific (set of) test file(s). E.g. running jest foo.test.js will not check any snapshots for foo.stories.js
I know this has been brought up in #3917 & #887 which both seem to be about solving problem#1 but neither of these solve problem#2
Describe the solution you'd like
I assume it's possible to spend a few hours/days to configure your way around this, but to me this seems like it should be a logical default. The current default setup requires quite some googling & manual configuration to solve problem#1 & does not solve problem#2
The text was updated successfully, but these errors were encountered:
I believe it was the default previously. We recently updated storybook from 5 to 6 and our snapshot location changed.
I thought I liked the new behaviour as it allowed us to review code changes and storyshot changes separately when multiple files were updated, but.. the default behaviour seems to be dumping them all according to path next to the file that launched the test is, which is definitely not ideal as we have other files in that directory
ie /test/vue.snapshot.test.js
outputs all the snashots to /test/{path to story}/__snapshots__/{name of story}.storyshot
which works out to /test/packages/components/button/vue/stories/__snapshots__/button.vue.stories.storyshot
The Storyshots addon is officially deprecated and will be removed in a future release of Storybook. To help with the transition process, we've created a migration guide for the available options and common use cases.
Is your feature request related to a problem? Please describe
Currently, the setup instructions read as follows:
There are 2 problems I've noticed with this:
__snapshots__/Storyshots.test.js.snap
file. This can become a nightmare to review pretty quicklyStoryshots.test.js
file is an arbitrary test file, it's not picked up by Jest if running a specific (set of) test file(s). E.g. runningjest foo.test.js
will not check any snapshots forfoo.stories.js
I know this has been brought up in #3917 & #887 which both seem to be about solving problem#1 but neither of these solve problem#2
Describe the solution you'd like
I assume it's possible to spend a few hours/days to configure your way around this, but to me this seems like it should be a logical default. The current default setup requires quite some googling & manual configuration to solve problem#1 & does not solve problem#2
The text was updated successfully, but these errors were encountered: