-
-
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-runtime breaks node.js 'module' module API #9710
Comments
Oops, comes from #9469, /cc @doniyor2109. I didn't know |
@hugebdu if you have |
@SimenB thanks, meanwhile I simply switched to |
Opened up a quick PR #9711. |
Here it was 🙈 Next time when mocking node modules, I will definitely look at the source code of nodejs. |
Thanks for the blazing-fast turnaround time on this. 😄 |
This seems to also affect all modules built with ESM:
Which points to https://github.com/standard-things/esm/blob/master/esm.js#L48 |
25.2.2 released with the fix. If it's still broken somehow we'll need to revert #9469 and revisit it later |
The fix is working fine for tests importing ESM-based dependencies. Thank you! |
This fixes my observed issue as well. Thanks again for hitting this so fast. |
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. |
🐛 Bug Report
Node.js's module module API is not compliant after gets instrumented by JEST
To Reproduce
This test will fail with
TypeError: Module is not a constructor
Expected behavior
Test should pass
Link to repl or repo (highly encouraged)
https://github.com/hugebdu/jest-bug
envinfo
The text was updated successfully, but these errors were encountered: