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
Currently, when there are errors at the test suite (file) level the CLI prints something friendly and helpful like:
> jest --json --outputFile=tmp/jest.json --testLocationInResults --verbose
FAIL ./sum.test.js
β Test suite failed to run
Cannot find module 'foobar' from 'sum.js'
Require stack:
sum.js
sum.test.js
> 1 | require("foobar");
| ^
2 |
3 | function sum(a, b) {
4 | return a + b;
at Resolver._throwModNotFoundError (node_modules/jest-resolve/build/resolver.js:487:11)
at Object.<anonymous> (sum.js:1:18)
at Object.<anonymous> (sum.test.js:1:29)
Test Suites: 1 failed, 1 total
Tests: 0 total
Snapshots: 0 total
Time: 0.167 s
Ran all test suites.
Test results written to: tmp/jest.json
This is quite helpful while debugging what went wrong in the test, but when looking at the JSON results, I only see:
Is there any interest in exposing more of the helpful text/context from the CLI message in the JSON payload? I might be able to spare some time to do this if so (it doesn't seem like a massively large undertaking - I believe we'd just have to expose a little more info in formatTestResult).
Motivation
We wrote a library which consumes Jest JSON and summarizes the information in the JSON results into a friendly message to help ease some of the pain of scrolling through CI logs to figure out what went wrong. This, however, is important information we'd like to show which we currently have no access to.
Example
No response
Pitch
While it's likely possible to expose a custom reporter to do this, it'd be challenging to otherwise maintain a 1:1 API with the existing JSON report as it's not implemented as a reporter today. If it was, we could likely call the original and augment with additional information.
The text was updated successfully, but these errors were encountered:
π Feature Proposal
Currently, when there are errors at the test suite (file) level the CLI prints something friendly and helpful like:
This is quite helpful while debugging what went wrong in the test, but when looking at the JSON results, I only see:
Is there any interest in exposing more of the helpful text/context from the CLI message in the JSON payload? I might be able to spare some time to do this if so (it doesn't seem like a massively large undertaking - I believe we'd just have to expose a little more info in
formatTestResult
).Motivation
We wrote a library which consumes Jest JSON and summarizes the information in the JSON results into a friendly message to help ease some of the pain of scrolling through CI logs to figure out what went wrong. This, however, is important information we'd like to show which we currently have no access to.
Example
No response
Pitch
While it's likely possible to expose a custom reporter to do this, it'd be challenging to otherwise maintain a 1:1 API with the existing JSON report as it's not implemented as a reporter today. If it was, we could likely call the original and augment with additional information.
The text was updated successfully, but these errors were encountered: