Tweak report

This commit is contained in:
Patrik Husfloen 2023-06-08 15:41:46 +02:00
parent 069594f458
commit 297e768b20
2 changed files with 13 additions and 11 deletions

View file

@ -181,18 +181,19 @@ function getSuitesReport(tr: TestRunResult, runIndex: number, options: ReportOpt
const suites = options.listSuites === 'failed' ? tr.failedSuites : tr.suites
if (suites.length > 0) {
const suitesTable = table(
['Test suite', 'Passed', 'Failed', 'Skipped', 'Time'],
[Align.Left, Align.Right, Align.Right, Align.Right, Align.Right],
['', 'Test suite', 'Passed', 'Failed', 'Skipped', 'Time'],
[Align.Center, Align.Left, Align.Right, Align.Right, Align.Right, Align.Right],
...suites.map((s, suiteIndex) => {
const tsTime = formatTime(s.time)
const tsName = s.name
const skipLink = options.listTests === 'none' || (options.listTests === 'failed' && s.result !== 'failed')
const tsAddr = options.baseUrl + makeSuiteSlug(runIndex, suiteIndex).link
const tsNameLink = skipLink ? tsName : link(tsName, tsAddr)
const passed = s.passed > 0 ? `${s.passed}${Icon.success}` : ''
const failed = s.failed > 0 ? `${s.failed}${Icon.fail}` : ''
const skipped = s.skipped > 0 ? `${s.skipped}${Icon.skip}` : ''
return [tsNameLink, passed, failed, skipped, tsTime]
const statusIcon = tr.failed > 0 ? Icon.fail : tr.passed > 0 ? Icon.success : Icon.skip
const passed = tr.passed
const failed = tr.failed
const skipped = tr.skipped
return [statusIcon, tsNameLink, passed, failed, skipped, tsTime]
})
)
sections.push(suitesTable)