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

fix: Reset local state of assertions when using hasAssertions #4498

Merged
merged 1 commit into from
Sep 18, 2017

Conversation

thymikee
Copy link
Collaborator

Summary

.hasAssertions leaked to every test case following the one it was declared in.
Also decided to extract setState call to a function named resetAssertionsState so it's easier to understand what it does.
Fixes #4496.

Test plan

Empty test without assertions. Fails on current master.

@cpojer cpojer merged commit 03fa502 into jestjs:master Sep 18, 2017
@cpojer
Copy link
Member

cpojer commented Sep 18, 2017

Nice!

@mattphillips
Copy link
Contributor

From the looks of it this fixes #3595 too and will also fix this issue in babel-jest-assertions

I just debugged the issue all the way to find the state not being reset and was about to open a PR and then found this one 😆 nice one @thymikee! At least I have a bit of a better understanding of how Jest works now 😄

@cpojer Do you know when this will be released?

@cpojer
Copy link
Member

cpojer commented Sep 25, 2017

This week.

@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

expect.hasAssertions() triggered in different test
4 participants