-
-
Notifications
You must be signed in to change notification settings - Fork 56
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
Error with jest-canvas-mock and jest.resetAllMocks() #103
Comments
Have you found any solution yet, I have the same problem, don't know how to setup mock before start. |
Not yet. @ducna-lts |
Another way is to create a setup file // mockCanvas.js
import canvasMock from 'jest-canvas-mock/lib/mock/prototype.js';
beforeEach(() => {
canvasMock();
}); and add that as a setup file in Jest config setupFilesAfterEnv: [
'mockCanvas.js'
], |
@hustcc @nicks I'm running into this issue as well and see that it seems to have been resolved by #98 several months back. Any chance y'all could make another release to get this fix out? It's even more needed since Jest changed the behavior of the |
@pbomb i don't have any special publishing powers on this repo. if it helps, my team used |
|
Hi, I'm using
jest.resetAllMocks()
inafterEach
like this:and then, the first test case is successful but the following tests fail, because
context
isundefined
:I have to hack like this:
Then all the test cases can be successful. But i still get an ERROR:
Is there a better way for us to use
jest-canvas-mock
withjest.resetAllMocks()
?Thanks!
The text was updated successfully, but these errors were encountered: