-
-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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: Fix support for test failures in async tests #11962
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the slow turnaround on this. Shouldn't this be done with the done(error)
API instead?
Yeah, I wanna write code like it. import initStoryshots from '@storybook/addon-storyshots'
import path from 'path'
initStoryshots({
asyncJest: true,
test: async ({ done }) => {
try {
expect(1).toEqual(2)
done()
} catch (error) {
done(error)
}
},
}) |
Is there any |
@kahirokunn i see. then WDYT about something more like: new Promise((done, reject) =>
testMethod({
done: (err) => (err ? reject(err) : done())
... |
@shilman I tried it and that worked for me. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
@shilman One more thing. |
@kahirokunn i don't have enough context on that to respond. maybe a separate PR and we can figure that out? |
Thanks a lot. |
Why CI is failed? 🤔 |
@kahirokunn ignore it! 😁 |
What I did
some times I wanna reject test like this.
jestjs/jest#6121 (comment)