You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running npx jest --coverage without --runInBand does not cause this bug and instead renders output such as:
Running coverage on untested files...Failed to collect coverage from /Users/slifty/Maestral/Code/personal/jesttest/src/foo.ts
ERROR: Jest worker encountered 3 child process exceptions, exceeding retry limit
STACK: Error: Jest worker encountered 3 child process exceptions, exceeding retry limit
at ChildProcessWorker.initialize (/Users/slifty/Maestral/Code/personal/jesttest/node_modules/jest-worker/build/workers/ChildProcessWorker.js:211:21)
at ChildProcessWorker._onExit (/Users/slifty/Maestral/Code/personal/jesttest/node_modules/jest-worker/build/workers/ChildProcessWorker.js:396:12)
at ChildProcess.emit (node:events:513:28)
at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
----------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
----------|---------|----------|---------|---------|-------------------
All files | 0 | 0 | 0 | 0 |
----------|---------|----------|---------|---------|-------------------
Test Suites: 1 failed, 1 total
Tests: 0 total
Snapshots: 0 total
Time: 4 s
Ran all test suites.
Running npx jest --runInBand --coverage only renders:
Running coverage on untested files...
and then the process exits with code 0.
Some other interesting "alternative outcomes":
If collectCoverageFrom is not specified then coverage is generated as expected and the process returns correct exit codes.
If the tests are able to run then then coverage is STILL not generated and the exit code is always 1 regardless of test outcomes.
I had originally opened this issue in the jest repository but they pointed out this issue does NOT happen with babel-jest and so the problem might be a bug in ts-jest
There is currently a bug in the `ts-jest` project [1] which causes
compile failures to result in a masked failing exit code *if test
coverage is being generated*.
The best solution would be to patch upstream, but in lieu of that we are
going to just run tests twice: once without coverage and once with
coverage.
Issue #457 npm run test:ci prints failures but exits success
[1] kulshekhar/ts-jest#4193
Version
29.1.1
Steps to reproduce
0
despite the errorsExpected behavior
I expect:
Actual behavior
Exit code
0
is returnedDebug log
ts-jest.log
Additional context
Running
npx jest --coverage
without--runInBand
does not cause this bug and instead renders output such as:Running
npx jest --runInBand --coverage
only renders:and then the process exits with code
0
.Some other interesting "alternative outcomes":
collectCoverageFrom
is not specified then coverage is generated as expected and the process returns correct exit codes.1
regardless of test outcomes.I had originally opened this issue in the jest repository but they pointed out this issue does NOT happen with
babel-jest
and so the problem might be a bug ints-jest
Environment
The text was updated successfully, but these errors were encountered: