Skip to content

Commit

Permalink
Cope with empty <testsuites /> or <testsuite /> node
Browse files Browse the repository at this point in the history
  • Loading branch information
ethomson committed Jan 25, 2023
1 parent b587e7a commit b266d9a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/test_parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,9 @@ export async function parseTap(data: string): Promise<TestResult> {
async function parseJunitXml(xml: any): Promise<TestResult> {
let testsuites

if (xml.testsuites) {
testsuites = xml.testsuites.testsuite
} else if (xml.testsuite) {
if ('testsuites' in xml) {
testsuites = xml.testsuites.testsuite || [ ]
} else if ('testsuite' in xml) {
testsuites = [ xml.testsuite ]
} else {
throw new Error("expected top-level testsuites or testsuite node")
Expand Down

0 comments on commit b266d9a

Please sign in to comment.