Skip to content

Commit

Permalink
Merge pull request #115 from dorny/java-junit-handle-missing-time
Browse files Browse the repository at this point in the history
Patch java-junit to handle missing time field
  • Loading branch information
dorny authored May 13, 2021
2 parents e873f73 + 72c193c commit 0ed324d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/parsers/java-junit/java-junit-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit 0ed324d

Please sign in to comment.