-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
jest.mock does not mock async methods in module #3135
Comments
I have worked around this by adding the following to my tests (but its obviously less that ideal):
|
+1, same problem |
Cannot repro, both tests pass in my case (I use |
It only happens if you use the native implementation of async / await. |
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. |
node: 7.6.0
os: macOS Sierra (10.12.3)
I have create a module with a method defined as async. When mocking that module in tests it does not mock the async method.
module.js
example.test.js
package.json
The test fails because the
asyncMethod
is not defined on the mocked module.The text was updated successfully, but these errors were encountered: