-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Closed
Labels
Description
TL;DR The issue is specific to Node 10.0.0; Try upgrading to 10.1.0 or above.
🐛 Bug Report
If my there is at least one expectation in my unit test that is not fulfilled at test time, the entire test suite "hangs" instead of reporting a failed ("red") test.
(On contrary, If all my expectations are fulfilled at test time, the tests does not seem to hang.)
To Reproduce
The following test code is an example.
describe(`Demo`, () => {
it(`Should Fail, not Hang`, () => {
expect(1).toEqual(2);
});
});
Run Jest from Git Bash/CMD, observe the following output:
$ yarn test
yarn run v1.6.0
(node:3316) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
$ jest -i
RUNS __tests__/3-1-single-array-multiple-stacks.spec.ts
Software/Package Versions:
jest: 22.4.3
ts-jest: 22.4.5
$ node --version
v10.0.0
$ npm --version
6.0.0
$ npm --version
6.0.0
$ tsc --version
Version 2.8.3
Expected behavior
The test should be reported as failing.
Run npx envinfo --preset jest
$ npx envinfo --preset jest
npx: installed 1 in 5.897s
System:
OS: Windows 10
CPU: x64 Intel(R) Core(TM) i5-3317U CPU @ 1.70GHz
Binaries:
Yarn: 1.6.0 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.0.0 - ~\AppData\Roaming\npm\npm.CMDanother-guy