mirror of
https://github.com/dorny/test-reporter.git
synced 2025-12-15 13:57:09 +01:00
fixing format
This commit is contained in:
parent
76a051e007
commit
ac305c191c
1 changed files with 14 additions and 3 deletions
|
|
@ -1,7 +1,11 @@
|
||||||
import {DEFAULT_LOCALE} from './utils/node-utils'
|
import {DEFAULT_LOCALE} from './utils/node-utils'
|
||||||
|
|
||||||
export class TestRunResult {
|
export class TestRunResult {
|
||||||
constructor(readonly path: string, readonly suites: TestSuiteResult[], private totalTime?: number) {}
|
constructor(
|
||||||
|
readonly path: string,
|
||||||
|
readonly suites: TestSuiteResult[],
|
||||||
|
private totalTime?: number
|
||||||
|
) {}
|
||||||
|
|
||||||
get tests(): number {
|
get tests(): number {
|
||||||
return this.suites.reduce((sum, g) => sum + g.tests, 0)
|
return this.suites.reduce((sum, g) => sum + g.tests, 0)
|
||||||
|
|
@ -40,7 +44,11 @@ export class TestRunResult {
|
||||||
}
|
}
|
||||||
|
|
||||||
export class TestSuiteResult {
|
export class TestSuiteResult {
|
||||||
constructor(readonly name: string, readonly groups: TestGroupResult[], private totalTime?: number) {}
|
constructor(
|
||||||
|
readonly name: string,
|
||||||
|
readonly groups: TestGroupResult[],
|
||||||
|
private totalTime?: number
|
||||||
|
) {}
|
||||||
|
|
||||||
get tests(): number {
|
get tests(): number {
|
||||||
return this.groups.reduce((sum, g) => sum + g.tests.length, 0)
|
return this.groups.reduce((sum, g) => sum + g.tests.length, 0)
|
||||||
|
|
@ -78,7 +86,10 @@ export class TestSuiteResult {
|
||||||
}
|
}
|
||||||
|
|
||||||
export class TestGroupResult {
|
export class TestGroupResult {
|
||||||
constructor(readonly name: string | undefined | null, readonly tests: TestCaseResult[]) {}
|
constructor(
|
||||||
|
readonly name: string | undefined | null,
|
||||||
|
readonly tests: TestCaseResult[]
|
||||||
|
) {}
|
||||||
|
|
||||||
get passed(): number {
|
get passed(): number {
|
||||||
return this.tests.reduce((sum, t) => (t.result === 'success' ? sum + 1 : sum), 0)
|
return this.tests.reduce((sum, t) => (t.result === 'success' ? sum + 1 : sum), 0)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue