The cli doesn't exit correctly when stdout is a non-tty
See original GitHub issueDo you want to request a feature or report a bug?
Bug
What is the current behavior?
If you are redirecting stdout to a file (or have stdout not connected to a tty in a similar way), then the jest-cli process will exit with 0 even if there are failing tests. If you execute jest from the cli without any kind of redirect in place, then you get a non-zero exit value for failing tests as expected.
It appears that this was introduced with the exit changes in this PR https://github.com/facebook/jest/pull/5313
What is the expected behavior?
A non-zero exit value in the case of test failures.
Please provide your exact Jest configuration and mention your Jest, node, yarn/npm version and operating system.
- node v6.11.4
- npm v3.10.10
- jest 22.1.1
- ubuntu 14.04
NOTE I updated the description since the original bug report with my latest findings
Issue Analytics
- State:
- Created 6 years ago
- Reactions:8
- Comments:36 (9 by maintainers)
Top GitHub Comments
I can confirm we are experiencing the same issue, all great locally but on Jenkins a failed test run exits with
0
. Pinning bothjest
andjest-cli
to22.1.0
fixes it.Same issue with jenkins and jest 24.9.0