mirror of
https://github.com/dorny/test-reporter.git
synced 2025-12-16 14:27:10 +01:00
Gracefully handle empty nested testsuite elements for JUnit.
This fixes an issue with mocha-junit-reporter returning empty root-level testsuite elements.
This commit is contained in:
parent
0d9714ddc7
commit
a3356fa639
4 changed files with 27 additions and 2 deletions
|
|
@ -48,6 +48,10 @@ export class JestJunitParser implements TestParser {
|
|||
}
|
||||
|
||||
private getGroups(suite: TestSuite): TestGroupResult[] {
|
||||
if (!suite.testcase) {
|
||||
return []
|
||||
}
|
||||
|
||||
const groups: {describe: string; tests: TestCase[]}[] = []
|
||||
for (const tc of suite.testcase) {
|
||||
let grp = groups.find(g => g.describe === tc.$.classname)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue