Proposal: classify uncaught errors in tests as "errors" not as "failures"
See original GitHub issueDo you want to request a feature or report a bug?
Feature
What is the current behavior?
Jest treats failed assertions and uncaught errors in a test case both as failures.
What is the expected behavior?
I maintain jest-junit, a testResultsProcessor that provides valid jUnit xml files for CI & reporting systems. This spec differentiates a test failure and a test error.
A test error, according to the junit spec, is classified as:
An errored test is one that had an unanticipated problem, for example an unchecked throwable; or a problem with the implementation of the test.
What I am proposing is that Jest adds an additional test status of “error” for these cases. The current documentation for testResultsProcessors shows the following test statuses:
"status": "failed" | "pending" | "passed",
I am more than happy to contribute and willing to take this work on myself, if necessary. But before I do I wanted to get feedback from Jest maintainers and the community if this would cause problems.
Please provide your exact Jest configuration
System: OS: macOS Sierra 10.12.6 CPU: x64 Intel® Core™ i7-4980HQ CPU @ 2.80GHz Binaries: Node: 8.5.0 Yarn: 1.5.1 npm: 5.3.0 npmPackages: jest: wanted: ^22.4.3 installed: 22.4.3
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:14 (8 by maintainers)
Top GitHub Comments
Yes, it would be amazing if runners could inject their own statuses, and colors for those statuses.
Basically, jest is really two things that would be really nice to make more separable: a test framework (a jasmine fork) and a super awesome parallel test runner/watcher.
@palmerj3 Were you able to look into it?
FWIW, I support
error
in addition tofailed
, but if we could implement it in a way which allows us to also support other statuses, such aswarning
, that’s be awesome.