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
Hello @GillesDebunne, thanks for opening the issue.
I'm not sure why you are adding jest-styled-components to your stories file, but it doesn't seem the right place.
Please check out storyshots, and this example of how to setup storybook with jest-styled-components from @terrencewwong.
Thank you very much!
The example indeed shows how to mix storyshots and jest-styled-components : add the import in the storyshots.test.js file, and it works.
However, in my case, I use a different solution inspired by storyshots, where each storybook story file is also a snapshot test. Basically, each story I create is also a snapshot test. As a result, I get a cleaner one snapshot per story structure.
This is why I created this simple repro case, where stories and import are mixed, and which highlights the problem.
Storyshots has an issue to create one snapshot per file. I will see if they face the same issue and how they solve it.
Repro steps:
Start a new cra project from scratch:
Then add storybook
Everything works as expected.
Then
yarn add --dev jest-styled-components
and editsrc/stories/index.js
, to addafter the other imports.
Run
yarn run storybook
again. It fails with this error message:Runnning on a mac, with yarn 1.1.0, cra 1.4.0, jest-styled-components 4.6.0, storybook 3.2.11
package.json.zip
The text was updated successfully, but these errors were encountered: