mirror of
https://github.com/dorny/test-reporter.git
synced 2025-12-17 14:57:09 +01:00
Tweak report
This commit is contained in:
parent
069594f458
commit
297e768b20
2 changed files with 13 additions and 11 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue