mirror of
https://github.com/dorny/test-reporter.git
synced 2026-05-07 11:07:35 +02:00
Add new parameter list-files for when there are multiple files in a report
This commit is contained in:
parent
093d99bd59
commit
a48134be3e
5 changed files with 182 additions and 7 deletions
10
src/main.ts
10
src/main.ts
|
|
@ -44,6 +44,7 @@ class TestReporter {
|
|||
readonly reporter = core.getInput('reporter', {required: true})
|
||||
readonly listSuites = core.getInput('list-suites', {required: true}) as 'all' | 'failed' | 'none'
|
||||
readonly listTests = core.getInput('list-tests', {required: true}) as 'all' | 'failed' | 'none'
|
||||
readonly listFiles = core.getInput('list-files', {required: true}) as 'all' | 'failed' | 'none'
|
||||
readonly maxAnnotations = parseInt(core.getInput('max-annotations', {required: true}))
|
||||
readonly failOnError = core.getInput('fail-on-error', {required: true}) === 'true'
|
||||
readonly failOnEmpty = core.getInput('fail-on-empty', {required: true}) === 'true'
|
||||
|
|
@ -71,6 +72,11 @@ class TestReporter {
|
|||
return
|
||||
}
|
||||
|
||||
if (this.listFiles !== 'all' && this.listFiles !== 'failed' && this.listFiles !== 'none') {
|
||||
core.setFailed(`Input parameter 'list-files' has invalid value`)
|
||||
return
|
||||
}
|
||||
|
||||
if (this.collapsed !== 'auto' && this.collapsed !== 'always' && this.collapsed !== 'never') {
|
||||
core.setFailed(`Input parameter 'collapsed' has invalid value`)
|
||||
return
|
||||
|
|
@ -177,7 +183,7 @@ class TestReporter {
|
|||
}
|
||||
}
|
||||
|
||||
const {listSuites, listTests, slugPrefix, onlySummary, useActionsSummary, badgeTitle, reportTitle, collapsed} = this
|
||||
const {listSuites, listTests, slugPrefix, listFiles, onlySummary, useActionsSummary, badgeTitle, reportTitle, collapsed} = this
|
||||
|
||||
const passed = results.reduce((sum, tr) => sum + tr.passed, 0)
|
||||
const failed = results.reduce((sum, tr) => sum + tr.failed, 0)
|
||||
|
|
@ -192,6 +198,7 @@ class TestReporter {
|
|||
listSuites,
|
||||
listTests,
|
||||
slugPrefix,
|
||||
listFiles,
|
||||
baseUrl,
|
||||
onlySummary,
|
||||
useActionsSummary,
|
||||
|
|
@ -224,6 +231,7 @@ class TestReporter {
|
|||
listSuites,
|
||||
listTests,
|
||||
slugPrefix,
|
||||
listFiles,
|
||||
baseUrl,
|
||||
onlySummary,
|
||||
useActionsSummary,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue