-
-
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
Mocking window not working on Node >= 7.3 #2785
Comments
Ok, new info -> in Node <= 7.2 works. Node > 7.2 fails.... Is there some known incompatibility issues? |
Maybe it's some kind of regression in Node, but nothing I've heard before. |
Ok, new info again... This is crazy.
WTF? |
P.D.: perhaps we could close it, still I'm very curious about the issue |
Ok, confirmed. I've just found @cpojer opened an issue and there is a regression in Node 7.3 (fixed by 7.5) that breaks some things nodejs/node#10492 This should be communicated somewhere in the docs, right? cc @thymikee |
Yup, that's a node issue. Let's look past this and never speak of Node 7.3 and Node 7.4 again. |
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
I've been using the following code for mocking the window (in TS, but should be the same for js). It used to work:
But now is not mocking the window correctly. So cannot check calls or call
mockClear
and that stuff:Curiously, it was happening in my TravisCI as well, but I stop caching node_modules (I was doing it) and now works again. But still locally I having that issue. Any clue?
You could reproduce it like this
Please provide your exact Jest configuration and mention your Jest, node, yarn/npm version and operating system.
The text was updated successfully, but these errors were encountered: