💥 Regression Report
This is more to make people aware of what I found than an issue that should be fixed. After updating to jest 25.1.0 I saw some of my test suites failing with errors like ReferenceError: describe is not defined and ReferenceError: beforeAll is not defined. Turns out the issue only occurs when using "testEnvironment": "node" with node 10.14.1 (and jest 25). Upgrading to node 10.14.2 fixes the issue (or not specifying a testEnvironment), so perhaps a node bug. Either way I wanted to post this here in case anyone comes across the same issue.
Last working version
Worked up to version: 24.*
Stopped working in version: 25.1.0
To Reproduce
Steps to reproduce the behavior:
I created a minimal repro here: https://github.com/AndrewLeedham/repros/tree/1f7e042e241e2f439bd69d1073bafffa5200beb5/packages/jest-25-node
- I wouldn't clone the repo because it is a monorepo and things get messy with deps. Just download it as a zip I guess.
- Either use nvm to switch to
10.4.1 or run the docker:build script.
- Depending on the above either run the
test script or docker:test script.
Expected behavior
No errors with global jest functions in test suites.
Link to repl or repo (highly encouraged)
https://github.com/AndrewLeedham/repros/tree/1f7e042e241e2f439bd69d1073bafffa5200beb5/packages/jest-25-node
Run npx envinfo --preset jest
Paste the results here:
System:
OS: macOS Mojave 10.14.6
CPU: (8) x64 Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz
Binaries:
Node: 10.14.1 - ~/.nvm/versions/node/v10.14.1/bin/node
Yarn: 1.21.1 - /usr/local/bin/yarn
npm: 6.4.1 - ~/.nvm/versions/node/v10.14.1/bin/npm
💥 Regression Report
This is more to make people aware of what I found than an issue that should be fixed. After updating to jest
25.1.0I saw some of my test suites failing with errors likeReferenceError: describe is not definedandReferenceError: beforeAll is not defined. Turns out the issue only occurs when using"testEnvironment": "node"with node10.14.1(and jest 25). Upgrading to node10.14.2fixes the issue (or not specifying atestEnvironment), so perhaps a node bug. Either way I wanted to post this here in case anyone comes across the same issue.Last working version
Worked up to version:
24.*Stopped working in version:
25.1.0To Reproduce
Steps to reproduce the behavior:
I created a minimal repro here: https://github.com/AndrewLeedham/repros/tree/1f7e042e241e2f439bd69d1073bafffa5200beb5/packages/jest-25-node
10.4.1or run thedocker:buildscript.testscript ordocker:testscript.Expected behavior
No errors with global jest functions in test suites.
Link to repl or repo (highly encouraged)
https://github.com/AndrewLeedham/repros/tree/1f7e042e241e2f439bd69d1073bafffa5200beb5/packages/jest-25-node
Run
npx envinfo --preset jestPaste the results here:
System: OS: macOS Mojave 10.14.6 CPU: (8) x64 Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz Binaries: Node: 10.14.1 - ~/.nvm/versions/node/v10.14.1/bin/node Yarn: 1.21.1 - /usr/local/bin/yarn npm: 6.4.1 - ~/.nvm/versions/node/v10.14.1/bin/npm