mirror of
https://github.com/dorny/test-reporter.git
synced 2025-12-16 14:27:10 +01:00
Improve report format to save space
This commit is contained in:
parent
768aefbed2
commit
e3bb634029
8 changed files with 504 additions and 504 deletions
|
|
@ -11,19 +11,15 @@ export const Icon = {
|
|||
fail: '❌' // ':x:'
|
||||
}
|
||||
|
||||
export function details(summary: string, content: string): string {
|
||||
return `<details><summary>${summary}</summary>${content}</details>`
|
||||
}
|
||||
|
||||
export function link(title: string, address: string): string {
|
||||
return `[${title}](${address})`
|
||||
}
|
||||
|
||||
type ToString = string | number | boolean | Date
|
||||
export function table(headers: ToString[], align: ToString[], ...rows: ToString[][]): string {
|
||||
const headerRow = `| ${headers.map(tableEscape).join(' | ')} |`
|
||||
const alignRow = `| ${align.join(' | ')} |`
|
||||
const contentRows = rows.map(row => `| ${row.map(tableEscape).join(' | ')} |`).join('\n')
|
||||
const headerRow = `|${headers.map(tableEscape).join('|')}|`
|
||||
const alignRow = `|${align.join('|')}|`
|
||||
const contentRows = rows.map(row => `|${row.map(tableEscape).join('|')}|`).join('\n')
|
||||
return [headerRow, alignRow, contentRows].join('\n')
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue