mirror of
https://github.com/dorny/test-reporter.git
synced 2025-12-15 22:07:09 +01:00
Fix edge case of one test assembly
This commit is contained in:
parent
3608ee03fd
commit
724497a84c
14 changed files with 65 additions and 6 deletions
10
dist/index.js
generated
vendored
10
dist/index.js
generated
vendored
|
|
@ -1595,7 +1595,12 @@ function getBadge(passed, failed, skipped, options) {
|
|||
}
|
||||
function getTestRunsReport(testRuns, options) {
|
||||
const sections = [];
|
||||
if (testRuns.length > 1 || options.onlySummary) {
|
||||
const totalFailed = testRuns.reduce((sum, tr) => sum + tr.failed, 0);
|
||||
if (totalFailed === 0) {
|
||||
sections.push(`<details><summary>Expand for details</summary>`);
|
||||
sections.push(` `);
|
||||
}
|
||||
if (testRuns.length > 0 || options.onlySummary) {
|
||||
const tableData = testRuns
|
||||
.filter(tr => tr.passed > 0 || tr.failed > 0 || tr.skipped > 0)
|
||||
.map(tr => {
|
||||
|
|
@ -1613,6 +1618,9 @@ function getTestRunsReport(testRuns, options) {
|
|||
const suitesReports = testRuns.map((tr, i) => getSuitesReport(tr, i, options)).flat();
|
||||
sections.push(...suitesReports);
|
||||
}
|
||||
if (totalFailed === 0) {
|
||||
sections.push(`</details>`);
|
||||
}
|
||||
return sections;
|
||||
}
|
||||
function getSuitesReport(tr, runIndex, options) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue