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
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).
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.
The text output (if large enough) can cover the entire screen and hide the fact that the test has failed.
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 generateOnFailure, maybe name it reportOnFailure?
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: