-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Closed
Labels
Description
🐛 Bug Report
When setting testEnvironment
to node and running a test I get ReferenceError: test is not defined
. If I remove testEnvironment: 'node'
from the config it runs fine. The same applies to describe
, beforeAll
...etc.
Note: it works fine on node 10.16.0
FAIL test/1.test.js
● Test suite failed to run
ReferenceError: test is not defined
> 1 | test('test1', () => {
| ^
2 | expect(1).toBe(1);
3 | });
at Object.<anonymous> (test/1.test.js:1:1)
Test Suites: 1 failed, 1 total
Tests: 0 total
Snapshots: 0 total
Time: 0.333s
Ran all test suites.
npm ERR! Test failed. See above for more details.
To Reproduce
Steps to reproduce the behavior:
jest.config.js
module.exports = {
testEnvironment: 'node'
}
test/1.test.js
test('test1', () => {
expect(1).toBe(1);
});
Expected behavior
Tests should run without errors when testEnvironment is set to node.
Link to repl or repo (highly encouraged)
envinfo
System:
OS: macOS 10.15.3
CPU: (12) x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
Binaries:
Node: 10.14.0 - /usr/local/bin/node
npm: 6.13.7 - /usr/local/bin/npm
npmPackages:
jest: ^25.1.0 => 25.1.0
tbadalov, alexnault, manwithsteelnerves, melissammbeff, danedavid and 4 more