mirror of
https://github.com/dorny/test-reporter.git
synced 2026-02-02 03:15:22 -08:00
Patch java-junit to handle missing time field
Normally a <testsuites> element has a time field. In some JUnit implementations this field is missing. This issue was found in junit XML created in matlab. At the moment I don't plan to explicitly support matlab - that would require to add more tests and documentation. However this patch should make it work with the existing java-junit parser.
This commit is contained in:
@@ -70,7 +70,8 @@ export class JavaJunitParser implements TestParser {
|
||||
return sr
|
||||
})
|
||||
|
||||
const time = parseFloat(junit.testsuites.$.time) * 1000
|
||||
const seconds = parseFloat(junit.testsuites.$?.time)
|
||||
const time = isNaN(seconds) ? undefined : seconds * 1000
|
||||
return new TestRunResult(filePath, suites, time)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user