-
-
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
[Bug]: mocking modules does not seem to work? #15351
Comments
I also added the sound player example tests from https://jestjs.io/docs/es6-class-mocks They also do not work... |
Also, am now trying to mock puppeteer.. test code does:
index.js
So I cannot get this to work either... Strangely, I can mock redis in this exact same way and it works just fine.. but not not local es6 files, and not puppeteer.. I just don't understand why I am having such trouble getting mocks to work. |
It looks like this issue is a duplicate of #10025 |
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. |
Version
29.7.0
Steps to reproduce
Expected behavior
3 tests passing
Actual behavior
Nothing works.. mocking the module for
./my-class.js
foo
is added, it is not there when importedMyClass
is overwritten, expecting a mocked out instance withsomeMethod
returningmocked-value
but instead it is the original implementation.await import('./my-class');
.. same result.Additional context
No response
Environment
The text was updated successfully, but these errors were encountered: