mirror of
https://github.com/dorny/test-reporter.git
synced 2025-12-17 06:47:09 +01:00
Add support for mocha-json
This commit is contained in:
parent
f285c4c6d7
commit
9b675bd55f
21 changed files with 1588 additions and 59 deletions
|
|
@ -26,6 +26,15 @@ export class TestRunResult {
|
|||
get failedSuites(): TestSuiteResult[] {
|
||||
return this.suites.filter(s => s.result === 'failed')
|
||||
}
|
||||
|
||||
sort(deep: boolean): void {
|
||||
this.suites.sort((a, b) => a.name.localeCompare(b.name))
|
||||
if (deep) {
|
||||
for (const suite of this.suites) {
|
||||
suite.sort(deep)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export class TestSuiteResult {
|
||||
|
|
@ -55,6 +64,15 @@ export class TestSuiteResult {
|
|||
get failedGroups(): TestGroupResult[] {
|
||||
return this.groups.filter(grp => grp.result === 'failed')
|
||||
}
|
||||
|
||||
sort(deep: boolean): void {
|
||||
this.groups.sort((a, b) => (a.name ?? '').localeCompare(b.name ?? ''))
|
||||
if (deep) {
|
||||
for (const grp of this.groups) {
|
||||
grp.sort()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export class TestGroupResult {
|
||||
|
|
@ -80,6 +98,10 @@ export class TestGroupResult {
|
|||
get failedTests(): TestCaseResult[] {
|
||||
return this.tests.filter(tc => tc.result === 'failed')
|
||||
}
|
||||
|
||||
sort(): void {
|
||||
this.tests.sort((a, b) => a.name.localeCompare(b.name))
|
||||
}
|
||||
}
|
||||
|
||||
export class TestCaseResult {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue