-
Notifications
You must be signed in to change notification settings - Fork 109
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
Jest tests return exit code 0 after failing tests #2
Comments
@reedflinch thank you for reporting! I will have a look and submit a patch. It does seem like you're probably right in referencing the issue. |
@reedflinch you were right! I tested this locally and pushed a change which ensures exit code 1 is achieved in Jest 18. Please update to 1.0.5. Thanks again for reporting this! |
Very much appreciate the quick fix, @palmerj3! You rock 👍 |
Is it just me or this issue just returned? :) Here's my stack:
After I'm running
Some other versions:
|
@aefox I'll take a look - thanks for reporting! |
@aefox I'm unable to reproduce this. I'm using jest 21.2.1 and jest-junit 3.1.0. |
@palmerj3 thanks for the quick response. let me try to find some time tomorrow to see if I can reproduce this in a non-production app |
This happens for jest-junit I am running Will try to put together a repro. |
Repro here https://github.com/jperl/repro-jest-junit. Run |
@jperl thank you! I will take a look. |
@jperl so when I clone your repo I see what you mean. It definitely has an exit 0 even with failing tests. But further digging I realized it has the proper exit codes if I don't invoke it with react-scripts. If you invoke directly with jest like so then exit codes are fine.
I am leaning toward this being an issue with react-scripts, not with jest-junit. Especially since I get incorrect exit codes from your repo even when using the default testResultsProcessor. E.g.
|
@jperl so I did some FURTHER digging.. this has been fascinating :) If you use the version of jest supplied by the current create-react-app then all works fine. But given that you are trying to use a version of jest that is not supported by the current react-scripts it's executing jest improperly. Given that setup that you're trying to configure I think the best course of action would be to file an issue in create-react-app or follow one of the few issues already dedicated to upgrading jest. |
@palmerj3 Thank you for digging into this! I don't know why I assumed |
This makes the package unusable for us in a CI environment - test steps rely on an exit code of 1 to properly signal failure. Perhaps related to winterbe/jest-teamcity-reporter#6?
With
jest-junit
configured as the testResultsProcessor:Without
"testResultsProcessor": "./node_modules/jest-junit"
in my jest config:The text was updated successfully, but these errors were encountered: