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

Storyshots Puppeteer: Fix support for over 1 assertions in async tests #12657

Merged
merged 2 commits into from Oct 4, 2020

Conversation

kahirokunn
Copy link
Contributor

What I did

I wanna do more assertions in the test like this.
https://jestjs.io/docs/en/asynchronous#callbacks

maybe this assertions should be in the test code and not in the runtime code.

@kahirokunn kahirokunn changed the title remove storyshots-puppeteer expect.assertions(1) storyshots-puppeteer: Fix support for over 1 assertions in async tests Oct 3, 2020
@kahirokunn kahirokunn changed the title storyshots-puppeteer: Fix support for over 1 assertions in async tests Storyshots Puppeteer: Fix support for over 1 assertions in async tests Oct 3, 2020
@@ -11,7 +11,6 @@ export const imageSnapshot = (customConfig: Partial<ImageSnapshotConfig> = {}) =
return puppeteerTest({
...config,
async testBody(page, options) {
expect.assertions(1);
Copy link
Member

Choose a reason for hiding this comment

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

WDYT about expect.hasAssertions() instead? it seems like there's already an assertion being made, and this would ensure that there >= 1 assertion.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's good idea!

@shilman shilman added addon: storyshots maintenance User-facing maintenance tasks labels Oct 3, 2020
@shilman shilman added this to the 6.1 maintenance milestone Oct 3, 2020
Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

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

🥇

@shilman shilman merged commit 870c4db into storybookjs:next Oct 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addon: storyshots maintenance User-facing maintenance tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants