mirror of
https://github.com/dorny/test-reporter.git
synced 2025-12-16 06:17:10 +01:00
early return for empty suites in get-report.ts
This commit is contained in:
parent
aa953f36f9
commit
d6c2d18e9d
1 changed files with 6 additions and 0 deletions
|
|
@ -195,6 +195,12 @@ function getSuitesReport(tr: TestRunResult, runIndex: number, options: ReportOpt
|
||||||
const sections: string[] = []
|
const sections: string[] = []
|
||||||
const suites = options.listSuites === 'failed' ? tr.failedSuites : tr.suites
|
const suites = options.listSuites === 'failed' ? tr.failedSuites : tr.suites
|
||||||
|
|
||||||
|
// suites gets filtered by options.listSuites, if the suites are empty, it should exit.
|
||||||
|
// currently it still displays all the non-failed items, making the report very verbose.
|
||||||
|
if (suites.length === 0) {
|
||||||
|
return sections
|
||||||
|
}
|
||||||
|
|
||||||
if (options.listSuites !== 'none') {
|
if (options.listSuites !== 'none') {
|
||||||
const trSlug = makeRunSlug(runIndex, options)
|
const trSlug = makeRunSlug(runIndex, options)
|
||||||
const nameLink = `<a id="${trSlug.id}" href="${options.baseUrl + trSlug.link}">${tr.path}</a>`
|
const nameLink = `<a id="${trSlug.id}" href="${options.baseUrl + trSlug.link}">${tr.path}</a>`
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue