mirror of
https://github.com/dorny/test-reporter.git
synced 2026-02-03 11:45:22 -08:00
Feature: Add summary title
Add new option `report-title` to add H1 title to the Markdown report Resolves #540
This commit is contained in:
committed by
Jozef Izso
parent
d1bf678c89
commit
0841c8130e
@@ -15,6 +15,7 @@ export interface ReportOptions {
|
||||
onlySummary: boolean
|
||||
useActionsSummary: boolean
|
||||
badgeTitle: string
|
||||
reportTitle: string
|
||||
}
|
||||
|
||||
const defaultOptions: ReportOptions = {
|
||||
@@ -23,7 +24,8 @@ const defaultOptions: ReportOptions = {
|
||||
baseUrl: '',
|
||||
onlySummary: false,
|
||||
useActionsSummary: true,
|
||||
badgeTitle: 'tests'
|
||||
badgeTitle: 'tests',
|
||||
reportTitle: 'Test Results'
|
||||
}
|
||||
|
||||
export function getReport(results: TestRunResult[], options: ReportOptions = defaultOptions): string {
|
||||
@@ -101,6 +103,8 @@ function getByteLength(text: string): number {
|
||||
|
||||
function renderReport(results: TestRunResult[], options: ReportOptions): string[] {
|
||||
const sections: string[] = []
|
||||
sections.push(`# ${options.reportTitle}`)
|
||||
|
||||
const badge = getReportBadge(results, options)
|
||||
sections.push(badge)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user