-
Notifications
You must be signed in to change notification settings - Fork 74
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
[Suggestion] Add a CLI option to only test stories with a play function #281
Comments
Hey there! This sounds like a good idea, in fact it should already be possible with the following ejected test-runner config: // test-runner-jest.config.js
const { getJestConfig } = require('@storybook/test-runner')
/**
* @type {import('@jest/types').Config.InitialOptions}
*/
module.exports = {
// The default configuration comes from @storybook/test-runner
...getJestConfig(),
testNamePattern: 'play-test', // only runs tests with play function
} However... This seems to break the test-runner, and I believe it's a bug in |
Just for the record: I'm trying to add test-runner to a Storybook I maintain and for several days I'm struggling with the problem of unstable tests For some of them I narrowed the problem down to "They touch Other options I considered to detect it's the runner and render fake instead of problematic story (if smoke-test fails) or a blank play if it's play-test, but it seems like not that good idea as hinting Jest to skip directly (which I imagine will also produce better report: not "all ok, won't tell which ones were actual and which ones were faked" but "some OK, other skipped") |
hi @jrencz, i made a PR to the emotion about the issue. Also there is a suggested way for |
@panvourtsis great news! I see that package Do I get it right that after your PR gets merged, then released, new version of |
@JReinhold What is happening about planned changes in Storybook's test-runner (testing stories with Vitest): https://youtu.be/veCxKeLl35A?feature=shared&t=9209, do we have to wait for Storybook 8.0? |
Hey everyone! We just released a test filtering feature in the test-runner v0.15.0, which you can read here. Stories with a play function automatically have a
And if you only want to run smoke tests instead, you can do the inverse:
Please try it out and provide feedback! Thank you! |
Thank you Storybook team ❤️ |
I would like to propose the addition of a new CLI option that would allow users to test only stories that contain a "play" function. This would be particularly helpful for those of us who are working with large Storybook projects and want to quickly test those stories.
Thank you
The text was updated successfully, but these errors were encountered: