Persist test summary on disk

This commit is contained in:
Ray Xu 2022-04-23 05:48:48 +00:00 committed by Zach Renner
parent c9b3d0e2bd
commit 83b7f42d2d
19 changed files with 1284 additions and 3655 deletions

View file

@ -136,16 +136,16 @@ function getTestRunsReport(testRuns: TestRunResult[], options: ReportOptions): s
const sections: string[] = []
if (testRuns.length > 1 || options.onlySummary) {
const tableData = testRuns.map((tr, runIndex) => {
const time = formatTime(tr.time)
const name = tr.path
const addr = options.baseUrl + makeRunSlug(runIndex).link
const nameLink = link(name, addr)
const passed = tr.passed > 0 ? `${tr.passed}${Icon.success}` : ''
const failed = tr.failed > 0 ? `${tr.failed}${Icon.fail}` : ''
const skipped = tr.skipped > 0 ? `${tr.skipped}${Icon.skip}` : ''
return [nameLink, passed, failed, skipped, time]
})
const tableData = testRuns
.filter(tr => tr.passed > 0 || tr.failed > 0 || tr.skipped > 0)
.map(tr => {
const time = formatTime(tr.time)
const name = tr.path
const passed = tr.passed > 0 ? `${tr.passed}${Icon.success}` : ''
const failed = tr.failed > 0 ? `${tr.failed}${Icon.fail}` : ''
const skipped = tr.skipped > 0 ? `${tr.skipped}${Icon.skip}` : ''
return [name, passed, failed, skipped, time]
})
const resultsTable = table(
['Report', 'Passed', 'Failed', 'Skipped', 'Time'],