mirror of
https://github.com/dorny/test-reporter.git
synced 2026-02-01 02:45:22 -08:00
Fix edge case of one test assembly
This commit is contained in:
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) {
|
||||
|
||||
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user