Skip to content
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

Document need for a custom snapshotResolver #131

Merged
merged 2 commits into from
Jun 28, 2022
Merged

Conversation

FokkeZB
Copy link
Contributor

@FokkeZB FokkeZB commented Jun 24, 2022

I noticed that (DOM) snapshots get stored alongside with the generated tests, and since they get generated in a temporary folder, that doesn't work.

Fortunately Jest supports a custom snapshotResolver, so I updated the README with instructions on how to use that.

@yannbf
Copy link
Member

yannbf commented Jun 24, 2022

Hey @FokkeZB thanks for your contribution! That should not be a problem unless you're using --stories-json mode. Was that the case? If so, would you mind adding such notes as optional, in the scenario of the stories json mode?

@FokkeZB
Copy link
Contributor Author

FokkeZB commented Jun 27, 2022

@yannbf I will. Although I must say I haven't been able to get the test runner to work without --stories-json. I get:

% yarn test-storybook                  
yarn run v1.22.17
$ test-storybook
No tests found, exiting with code 1
Run with `--passWithNoTests` to exit with code 0
In /Users/fokkezb/Code/zdl-editor/packages/storybook
  175 files checked.
  testMatch: /Users/fokkezb/Code/zdl-editor/packages/storybook/stories/Welcome.stories.mdx, /Users/fokkezb/Code/zdl-editor/packages/storybook/stories/architecture/*.stories.@(mdx|ts|tsx), /Users/fokkezb/Code/zdl-editor/packages/storybook/stories/terminology/*.stories.@(mdx|ts|tsx), /Users/fokkezb/Code/zdl-editor/packages/storybook/stories/concepts/*.stories.@(mdx|ts|tsx), /Users/fokkezb/Code/zdl-editor/packages/storybook/stories/development/*.stories.@(mdx|ts|tsx), /Users/fokkezb/Code/zdl-editor/packages/storybook/stories/service/*.stories.@(mdx|ts|tsx), /Users/fokkezb/Code/zdl-editor/packages/storybook/stories/**/*.stories.@(mdx|ts|tsx), /Users/fokkezb/Code/zdl-editor/node_modules/@zapier/editor/src/**/*.stories.@(mdx|ts|tsx) - 0 matches
  testPathIgnorePatterns: /node_modules/ - 175 matches
  testRegex:  - 0 matches
Pattern:  - 0 matches

And that's it 🤷

@yannbf
Copy link
Member

yannbf commented Jun 27, 2022

That's odd! Can you reach out on twitter?

@FokkeZB
Copy link
Contributor Author

FokkeZB commented Jun 28, 2022

See #133 for the bug that causes --no-stories-json not to work for us.

@FokkeZB
Copy link
Contributor Author

FokkeZB commented Jun 28, 2022

@yannbf I've updated the PR.

Copy link
Member

@yannbf yannbf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Thanks a lot for your contribution @FokkeZB !

@yannbf yannbf merged commit 1f82ebd into storybookjs:next Jun 28, 2022
@yannbf yannbf mentioned this pull request Jul 12, 2022
@github-actions
Copy link

🚀 PR was released in v0.4.0 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants