Jest 27: tests fail on node 10 related to `globalThis`
See original GitHub issue🐛 Bug Report
On Node 10, tests failed with error related to globalThis
Test suite failed to run
evalmachine.<anonymous>:1
globalThis
^
ReferenceError: globalThis is not defined
at evalmachine.<anonymous>:1:1
To Reproduce
For some reasons I cannot reproduce on my Mac, but it happened to CI. See https://github.com/thymikee/jest-preset-angular/pull/676/checks?check_run_id=1570469726
Steps to reproduce the behavior:
- Check out https://github.com/ahnpnl/jest-preset-angular/tree/jest-27
- Make sure your computer is using Node 10
- Install deps with
yarn
- Run
yarn test:e2e
Related PR https://github.com/thymikee/jest-preset-angular/pull/676
Expected behavior
Should not throw error related to globalThis
, like Node 12 and Node 14.
Link to repl or repo (highly encouraged)
https://github.com/ahnpnl/jest-preset-angular/tree/jest-27
envinfo
System:
OS: macOS 11.1
CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
Binaries:
Node: 14.15.1 - /usr/local/bin/node
Yarn: 1.22.10 - /usr/local/bin/yarn
npm: 7.0.15 - /usr/local/bin/npm
npmPackages:
jest: 27.0.0-next.2 => 27.0.0-next.2
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:12 (5 by maintainers)
Top Results From Across the Web
Troubleshooting - Jest
Use this guide to resolve issues with Jest. Tests are Failing and You Don't Know Why. Try using the debugging support built into...
Read more >Jest test fails with "window is not defined" - Stack Overflow
Jest's testEnvironment default used to be jsdom . It was changed to node starting with version 27. You can set testEnvironment: 'jsdom' in...
Read more >ts-jest - npm
A Jest transformer with source map support that lets you use Jest to test projects written in TypeScript. Latest version: 29.0.3, ...
Read more >How to use the jest-util.installCommonGlobals function ... - Snyk
defaultView); // Node's error-message stack size is limited at 10, but it's pretty useful // to see more than that when a test...
Read more >jest | Yarn - Package Manager
Delightful JavaScript Testing. ... Instant Feedback: Failed tests run first. ... between running all tests or only test files related to changed files....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
There is a stalled PR fixing it: https://github.com/jsdom/jsdom/pull/2975
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.