Merge pull request #2 from cristidumitru/main

Avoid NaN in totalTime
This commit is contained in:
Luis Penagos 2022-10-20 08:27:43 -05:00 committed by GitHub
commit 2b9a05fec4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 3 deletions

View file

@ -1,6 +1,6 @@
![Tests failed](https://img.shields.io/badge/tests-2%20passed%2C%202%20failed%2C%201%20skipped-critical)
## ❌ <a id="user-content-r0" href="#r0">fixtures/external/go/go-junit-report.xml</a>
**5** tests were completed in **NaNms** with **2** passed, **2** failed and **1** skipped.
**5** tests were completed in **1s** with **2** passed, **2** failed and **1** skipped.
|Test suite|Passed|Failed|Skipped|Time|
|:---|---:|---:|---:|---:|
|[github.com/company/package1](#r0s0)||||0ms|

View file

@ -123,6 +123,6 @@ TestRunResult {
"totalTime": 835,
},
],
"totalTime": NaN,
"totalTime": undefined,
}
`;

View file

@ -43,7 +43,10 @@ export class GoJunitParser implements TestParser {
return sr
})
const time = parseFloat(junit.testsuites.$.time) * 1000
const time =
junit.testsuites.$?.time === undefined
? undefined
: parseFloat(junit.testsuites.$.time) * 1000
return new TestRunResult(path, suites, time)
}