mirror of
https://github.com/dorny/test-reporter.git
synced 2025-12-17 06:47:09 +01:00
Avoid NaN in totalTime
This commit is contained in:
parent
e8917857c2
commit
99678f922b
3 changed files with 6 additions and 3 deletions
|
|
@ -1,6 +1,6 @@
|
||||||

|

|
||||||
## ❌ <a id="user-content-r0" href="#r0">fixtures/external/go/go-junit-report.xml</a>
|
## ❌ <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|
|
|Test suite|Passed|Failed|Skipped|Time|
|
||||||
|:---|---:|---:|---:|---:|
|
|:---|---:|---:|---:|---:|
|
||||||
|[github.com/company/package1](#r0s0)||||0ms|
|
|[github.com/company/package1](#r0s0)||||0ms|
|
||||||
|
|
|
||||||
|
|
@ -123,6 +123,6 @@ TestRunResult {
|
||||||
"totalTime": 835,
|
"totalTime": 835,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
"totalTime": NaN,
|
"totalTime": undefined,
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,10 @@ export class GoJunitParser implements TestParser {
|
||||||
return sr
|
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)
|
return new TestRunResult(path, suites, time)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue