Skip to content

Commit

Permalink
Add suite name to annotation title
Browse files Browse the repository at this point in the history
  • Loading branch information
Michal Dorner committed Nov 29, 2020
1 parent bff3069 commit 04a8489
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions __tests__/__snapshots__/jest-junit.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Received: false
at processTicksAndRejections (internal/process/task_queues.js:97:5)",
"path": "__tests__/main.test.js",
"start_line": 10,
"title": "Test Failed: Failing test",
"title": "Test Failed: 'Failing test' [__tests__\\\\main.test.js]",
},
Object {
"annotation_level": "failure",
Expand All @@ -34,7 +34,7 @@ Received: false
at processTicksAndRejections (internal/process/task_queues.js:97:5)",
"path": "lib/main.js",
"start_line": 2,
"title": "Test Failed: Exception in target unit",
"title": "Test Failed: 'Exception in target unit' [__tests__\\\\main.test.js]",
},
Object {
"annotation_level": "failure",
Expand All @@ -49,7 +49,7 @@ Received: false
at processTicksAndRejections (internal/process/task_queues.js:97:5)",
"path": "__tests__/main.test.js",
"start_line": 21,
"title": "Test Failed: Exception in test",
"title": "Test Failed: 'Exception in test' [__tests__\\\\main.test.js]",
},
Object {
"annotation_level": "failure",
Expand All @@ -70,7 +70,7 @@ Received: false
at runTest (C:\\\\Users\\\\Michal\\\\Workspace\\\\dorny\\\\test-check\\\\reports\\\\jest\\\\node_modules\\\\jest-runner\\\\build\\\\runTest.js:472:34)",
"path": "__tests__/second.test.js",
"start_line": 1,
"title": "Test Failed: Timeout test",
"title": "Test Failed: 'Timeout test' [__tests__\\\\second.test.js]",
},
],
"summary": "# jest tests ❌
Expand Down
2 changes: 1 addition & 1 deletion src/parsers/jest-junit/jest-junit-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ function getAnnotations(junit: JunitReport, workDir: string, trackedFiles: strin
end_line: src.line,
path: src.file,
message: ex,
title: `Test Failed: ${tc.$.name}`
title: `Test Failed: '${tc.$.name}' [${suite.$.name}]`
})
}
}
Expand Down

0 comments on commit 04a8489

Please sign in to comment.