mirror of
https://github.com/dorny/test-reporter.git
synced 2025-12-15 13:57:09 +01:00
Fix badge image by correctly encoding the URI components
This commit is contained in:
parent
c883ae9738
commit
de77f76b7e
1 changed files with 8 additions and 2 deletions
|
|
@ -145,8 +145,10 @@ function getBadge(passed: number, failed: number, skipped: number, options: Repo
|
||||||
color = 'yellow'
|
color = 'yellow'
|
||||||
}
|
}
|
||||||
const hint = failed > 0 ? 'Tests failed' : 'Tests passed successfully'
|
const hint = failed > 0 ? 'Tests failed' : 'Tests passed successfully'
|
||||||
const uri = encodeURIComponent(`${options.badgeTitle}-${message}-${color}`)
|
const encodedBadgeTitle = encodeImgShieldsURIComponent(options.badgeTitle)
|
||||||
return ``
|
const encodedMessage = encodeImgShieldsURIComponent(message)
|
||||||
|
const encodedColor = encodeImgShieldsURIComponent(color)
|
||||||
|
return ``
|
||||||
}
|
}
|
||||||
|
|
||||||
function getTestRunsReport(testRuns: TestRunResult[], options: ReportOptions): string[] {
|
function getTestRunsReport(testRuns: TestRunResult[], options: ReportOptions): string[] {
|
||||||
|
|
@ -305,3 +307,7 @@ function getResultIcon(result: TestExecutionResult): string {
|
||||||
return ''
|
return ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function encodeImgShieldsURIComponent(component: string): string {
|
||||||
|
return encodeURIComponent(component).replace(/-/g, '--')
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue