1
0
Fork 0
mirror of https://github.com/dorny/test-reporter.git synced 2026-03-21 23:52:12 +01:00

Report jest-junit testsuite errors as failures

Test errors are different (represented differently in the JUnit XML
output from jest-junit) to test _failures_. Failures are tests
which ran and failed, errors are for tests/test suites which
did not even run because the test code itself didn't build
or didn't execute correctly.

jest-junit has an option to enable reporting of test suite errors,
but test-reporter then interprets these as successful tests.
This commit is contained in:
Jozef Izso 2026-03-15 13:07:22 +01:00
parent 540c28072b
commit f8ae4deee6
Failed to extract signature
7 changed files with 141 additions and 3 deletions

View file

@ -1,5 +1,68 @@
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
exports[`jest-junit tests jest testsuite errors example test results matches snapshot 1`] = `
TestRunResult {
"path": "fixtures/test-errors/jest/jest-test-results.xml",
"suites": [
TestSuiteResult {
"groups": [
TestGroupResult {
"name": "Test suite failed to run",
"tests": [
TestCaseResult {
"error": {
"details": " ● Test suite failed to run
tsconfig.json:13:3 - error TS6258: 'typeRoots' should be set inside the 'compilerOptions' object of the config json file
13 "typeRoots": ["./src/lib/types", "./node_modules/@types"],
~~~~~~~~~~~
",
"line": undefined,
"path": undefined,
},
"name": "libs/foo.spec.ts",
"result": "failed",
"time": 0,
},
],
},
],
"name": "libs/foo.spec.ts",
"totalTime": 0,
},
TestSuiteResult {
"groups": [
TestGroupResult {
"name": "Test suite failed to run",
"tests": [
TestCaseResult {
"error": {
"details": " ● Test suite failed to run
tsconfig.json:13:3 - error TS6258: 'typeRoots' should be set inside the 'compilerOptions' object of the config json file
13 "typeRoots": ["./src/lib/types", "./node_modules/@types"],
~~~~~~~~~~~
",
"line": undefined,
"path": undefined,
},
"name": "libs/bar.spec.ts",
"result": "failed",
"time": 0,
},
],
},
],
"name": "libs/bar.spec.ts",
"totalTime": 0,
},
],
"totalTime": 646,
}
`;
exports[`jest-junit tests parsing ESLint report without timing information works - PR #134 1`] = `
TestRunResult {
"path": "fixtures/jest-junit-eslint.xml",