-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Don't generate coverage reports when tests fail. #2908
Comments
Personally I agree that coverage should not be reported at all when tests fail. There should be no use for coverage report when tests fail, as the test execution stops where ever the error happens. Even if someone is posting the results to some 3rd party coverage service, the overall coverage is not likely to meet the thresholds when tests fail.
Especially in watch-mode this must be frustrating as users have to scroll up past the coverage report to see the actual error. But it seems that Jest, NYC and c8 report the coverage even when test execution fails. We might want to keep same behaviour as default, and introduce a new configuration flag for this. Instead of |
If it's the standard across other tools to generate then that's fine and a |
Clear and concise description of the problem
A test coverage report (either text or generated html/json) does not have a lot of value if the test run itself has failed. The text output (if large enough) can cover the entire screen and hide the fact that the test has failed.
Suggested solution
If the test failed, don't show or generate any coverage report.
Alternative
A configuration flag could be useful as well, for those that want the older behavior (or the other way around).
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: