-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
TypeError: jest.restoreAllMocks is not a function #5059
Comments
+1 |
I'm unable to reproduce this, can you give a snippet which reproduces? |
Thank you for looking into this @SimenB I updated app.test.js to the following:
If I change afterEach to afterAll, the test would pass. |
I still cannot reproduce this... Are you sure you are on latest version of jest? This is my repro case: https://gist.github.com/anonymous/7e1f26019551ec8acdb287c4cf89ce27 I get a warning from react because of missing raf (can be fixed by |
Closing until we can reproduce this. Happy to reopen if we can, of course 🙂 |
thanks @SimenB. Looks like you are right, at least for the create-react-app example. The actual project where this is happening does seem to have the correct version though, so I will need to investigate this further. thanks for your help. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Using the latest version of jest (21.2.1), calls to
jest.restoreAllMocks()
Is failing with
This maybe inside a test, or inside the afterEach.
However, it seems to work inside an afterAll?
The problem seems to have been mentioned and supposedly resolved here:
#4436
However, I created a new app using create-react-app, added a jest.restoreAllMock in the test, and it fails with the same error.
Is anyone else hitting this problem?
The text was updated successfully, but these errors were encountered: