-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
[storyshots] Skipping storyshot testing on stories that will never pass/render properly #2898
Comments
Hodor: #1578 Bad google fu |
Just to follow up on this in case anyone ever lands here, I added this import initStoryshots, { renderOnly } from '@storybook/addon-storyshots';
initStoryshots({
suite: '1.Atoms',
storyKindRegex:/^1\.Atoms(?!.*(\u26A0)).*/,
test: renderOnly
}); The
|
man... why is this a regex option and not a filter function of some kind? |
Is there some way of reading the story options in the test? If not, there really really should be. I want to do this and I also don't want to write weird Regex, or have to name stories that I don't want tested in a specific way (though the Regexing the name of something in order to determine its properties is a red flag to me, and it's disappointing for it to be the "correct" way to do something. |
export const Exception = () => {
throw new Error('storyFn threw an error! WHOOPS');
};
Exception.story = {
name: 'story throws exception',
parameters: {
storyshots: { disable: true },
},
}; |
@shilman this is great - could it be included in the documentation? |
@MattFisher sure, mind raising a PR? |
Issue details
Storyshots is running all of my stories through snapshot testing. I have recently started using react-highcharts, which has issues with jest. There is currently no fix for this that I can find.
Working with Highcharts and Storybook however, B-E-A-utiful
I also have a habit of creating stories of components that have missing props (intentionally) which will also cause errors.
Right now this only bothers me, but if at some point in the future we integrate our tests with an automated build pipeline I'll have no choice but to remove storyshots (boo).
So, to my question:
Is it possible to configure storyshots to not run a particular story or group of stories?
Steps to reproduce
Proposition
The text was updated successfully, but these errors were encountered: