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
mockReset doesn't work well with calledWith #22
Comments
regevbr
changed the title
mockReset doesn't clear the call stack of calledWithFn
mockReset doesn't work well with calledWith
Mar 31, 2020
the fix is pretty easy, we need to check if the jest.fn() has an implementation, and if not, mock it and reset the stack. PR is coming soon |
regevbr
added a commit
to regevbr/jest-mock-extended
that referenced
this issue
Mar 31, 2020
regevbr
added a commit
to regevbr/jest-mock-extended
that referenced
this issue
Mar 31, 2020
regevbr
added a commit
to regevbr/jest-mock-extended
that referenced
this issue
Apr 2, 2020
regevbr
added a commit
to regevbr/jest-mock-extended
that referenced
this issue
Apr 3, 2020
regevbr
added a commit
to regevbr/jest-mock-extended
that referenced
this issue
Jun 11, 2020
marchaos
added a commit
that referenced
this issue
Jun 11, 2020
bug: mockReset doesn't work well with calledWith #22
Beraliv
pushed a commit
to Beraliv/jest-mock-extended
that referenced
this issue
May 1, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When performing mockReset, the jest.fn() method is being reset which is great, but the inner state of the calledWith scope is maintained, thus the jest.fn() is not called again with mockImplementation and the call stack just gets piled up
The text was updated successfully, but these errors were encountered: