This commit is contained in:
Pierre Chalamet 2024-06-29 22:25:29 +02:00
parent 95058abb17
commit 5c90b26631
18 changed files with 37 additions and 18 deletions

View file

@ -138,7 +138,7 @@ function getBadge(passed: number, failed: number, skipped: number, options: Repo
}
const hint = failed > 0 ? 'Tests failed' : 'Tests passed successfully'
const uri = encodeURIComponent(`${options.badgeTitle}-${message}-${color}`)
return `![${hint}](https://img.shields.io/badge/${uri})`
return `[![${hint}](https://img.shields.io/badge/${uri})](#test-report)`
}
function getTestRunsReport(testRuns: TestRunResult[], options: ReportOptions): string[] {
@ -149,6 +149,8 @@ function getTestRunsReport(testRuns: TestRunResult[], options: ReportOptions): s
sections.push(` `)
}
sections.push('# <a name="test-report"></a> Tests report')
if (testRuns.length > 0 || options.onlySummary) {
const tableData = testRuns
.filter(tr => tr.passed > 0 || tr.failed > 0 || tr.skipped > 0)