-
-
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
automock is crashing #9576
Comments
I was able to reproduce this issue and appears the problem is with mocking modules that return a method. Here is a simple example: //my-module
function setup() {
return {
stuff: 'it'
};
}
module.exports = setup; With mocking, That specific issue is from the |
I'm also seeing this issue from the |
I'm having the same error when using automock true. |
this is actually a major issue - i've just been spending hours trying to figure out why automocking is failing using jest.mock('my_node_module_name'); when automocking a class accessing I tried debugging by creating a custom mock in mocks with the same name as the node_modules library and im receiving It seems that these might be related? |
i didnt receive this error until I added This hasnt been picked up in months and renders this package pretty defunct for our integration tests. Any news on an update or fix? |
looks like this links to #6127 |
This issue is stale because it has been open for 1 year with no activity. Remove stale label or comment or this will be closed in 30 days. |
Still relevant |
This issue is stale because it has been open for 1 year with no activity. Remove stale label or comment or this will be closed in 30 days. |
Still relevant |
π Bug Report
When setting in
jest.config.js
propertyautomock: true
the tests run is crashing with errorTo Reproduce
Consider two files:
index.js
index.test.js
Steps to reproduce the behavior:
run
npx jest
Expected behavior
Jest should not crash
Link to repl or repo (highly encouraged)
https://github.com/Alexsey/jest-automock-crash
envinfo
The text was updated successfully, but these errors were encountered: