Skip to content

Tests unexpectedly fail in Node 6 #5159

Closed

Description

@m-allanson

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)

Activity

  1. thymikee commented on Dec 22, 2017

    @thymikee
    Contributor

    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

  2. m-allanson commented on Dec 22, 2017

    @m-allanson
    Author

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

  3. github-actions commented on May 13, 2021

    @github-actions

    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.

  4. locked as resolved and limited conversation to collaborators on May 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions