Skip to content

Commit

Permalink
#31: Make failure text optional (#32)
Browse files Browse the repository at this point in the history
- Made failure text optional
- removed unnecessary variable, inlined return
- Updated packages (npm audit fix)
  • Loading branch information
turing85 authored Apr 4, 2023
1 parent f0df84c commit 8af4e4d
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 62 deletions.
4 changes: 2 additions & 2 deletions 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.

80 changes: 25 additions & 55 deletions package-lock.json

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

5 changes: 2 additions & 3 deletions src/parsers/java-junit/java-junit-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ export class JavaJunitParser implements TestParser {
: junit.testsuites.testsuite.map(ts => {
const name = ts.$.name.trim()
const time = parseFloat(ts.$.time) * 1000
const sr = new TestSuiteResult(name, this.getGroups(ts), time)
return sr
return new TestSuiteResult(name, this.getGroups(ts), time)
})

const seconds = parseFloat(junit.testsuites.$?.time)
Expand Down Expand Up @@ -124,7 +123,7 @@ export class JavaJunitParser implements TestParser {
}

const failure = failures[0]
const details = typeof failure === 'object' ? failure._ : failure
const details = typeof failure === 'object' ? failure._ ?? "" : failure
let filePath
let line

Expand Down
2 changes: 1 addition & 1 deletion src/parsers/java-junit/java-junit-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export interface TestCase {
}

export interface Failure {
_: string
_?: string
type: string
message: string
}

0 comments on commit 8af4e4d

Please sign in to comment.