Skip to content
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

Tests unexpectedly fail in Node 6 #5159

Closed
m-allanson opened this issue Dec 22, 2017 · 3 comments
Closed

Tests unexpectedly fail in Node 6 #5159

m-allanson opened this issue Dec 22, 2017 · 3 comments

Comments

@m-allanson
Copy link

Do you want to request a feature or report a bug?
This might be a bug.

What is the current behavior?
I have a small set of tests that pass on Node 8, but fail on Node 6.

The tests have a beforeEach() that resets the state of two global properties. Each test then sets the properties to different values before making assertions. in Node 6 it seems that the beforeEach reset isn't being applied.

There's a basic demo repo here: https://github.com/m-allanson/jest-global-test

Which is based on the behaviour found here: gatsbyjs/gatsby#3233

What is the expected behavior?
The tests should pass in both Node 8 and Node 6.

Jest version: 22.0.3
Yarn version: 1.3.2
Node 6 version: 6.12.2
Node 8 version: 8.9.3
OS: MacOS Sierra 10.12.6 (also observed in Travis CI's Trusty environment https://travis-ci.org/gatsbyjs/gatsby/builds/319991766)

@thymikee
Copy link
Collaborator

IIRC this was a bug in Node 6 fixed in Node 8 while rewriting some VM specific logic. I can’t search for it currently because I’m on a shitty mobile connection. You can usually bypass it by setting these values to undefined

@m-allanson
Copy link
Author

That's great 👍, thanks for the swift reply.

@github-actions
Copy link

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.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants