-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with jest 22.4.2 and 0 exit code on failure #5841
Comments
Can you set up a reproduction repo? /cc @mjesun |
Here's some extra info for whoever investigates this. |
We definitely need something to repro. Both changes mentioned were done way before |
@SimenB we're also seeing the same issue on |
I don't have a reproducible demo yet, however I found out that it only occurs if I perform code coverage as part of testing. If I do not do the code coverage, then the error is properly reported back. |
Actually, the coverage has nothing to do with that problem, it is just that I was also using --bail when not performing the coverage. And when --bail is specified it does a hard exit. In my case, I managed to fix using various ways:
Because I've been using For those interested, here is the electron.js file I'm using to run jest inside electron that properly detect the exit code of jest:
|
This is still an issue with the latest version of Jest, and a few (if not all) versions in the past 8 months. On Windows. |
Yes pretty annoying, I also have the same issue on Ubuntu 18.04. yarn test --watchAll=false &> /dev/null
echo $?
0
CI=1 yarn test --watchAll=false &> /dev/null
echo $?
1 |
I can confirm @AndreMiras' behavior with Jest@24.8.0. |
Still see this issue in 24.8.0 but can't get @AndreMiras approach to work. The exit code is always 0 on a failure |
I also still see this issue in 24.8.0 and 24.9.0. can't get @AndreMiras 's approach to work :( . The exit code is always 0 on any failure. |
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. |
Since our upgrade to 22.4.x, our batch scripts are not detecting when tests are failing because it always returns 0 as exit code. We were previously using 21.2.1 which worked properly.
I'm not completely sure, but it seems to be related to the changes made in #5313 and #5332. Any idea why it is not set properly anymore?
This is on Windows.
The text was updated successfully, but these errors were encountered: