-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Allow custom test
function for storyshots
#1034
Comments
I implemented my suggestion in #1035, but we can do something else still. |
tmeasday
added a commit
that referenced
this issue
May 15, 2017
tmeasday
added a commit
that referenced
this issue
May 15, 2017
@rogovdm do you mean to extract this file into its own package? |
tmeasday
added a commit
that referenced
this issue
May 21, 2017
tmeasday
added a commit
that referenced
this issue
May 21, 2017
tmeasday
added a commit
that referenced
this issue
May 21, 2017
This was referenced May 21, 2017
ndelangen
pushed a commit
that referenced
this issue
May 24, 2017
Is this done ? @tmeasday |
Yes, that is what I meant by the |
Released with v3! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently, storyshots does two things: (a) it sets up a Jest test for each story, and (b) it defines the body of that test to be a vanilla snapshot test.
However, there are different things you may want to do in step (b), for instance:
noMatchSnapshots
option. #917, Support for testing storybook breaks on each code commit #547, Reflect render errors on left panel #1032)createNodeMock
(TypeError: w.default.findDOMNode is not a function #876, Allow passing options to react-test-renderer .create() method #881, Pass options to test renderer storybook-eol/storyshots#98)This issue proposes allowing configuring the body of the test (although keeping the current as the default). First proposed here: #917 (comment)
There is a question of how to best implement this. The simplest thing is simply an option to
initStoryshots
:@theinterned made a suggestion around lifecycle methods here -- can you provide a bit more detail about how that might be used?
In terms of implementing the use cases above, I would suggest we export "test bodies" that do the standard things from storyshots. So you could do
The text was updated successfully, but these errors were encountered: