mirror of
https://github.com/dorny/test-reporter.git
synced 2025-12-16 14:27:10 +01:00
Gracefully handle empty failure tags
This commit fixes #137. Some JUnit generators emit an empty failure tag, with only a message property set. In those cases, the parser crashes when trying to match the failure with a source file. Since this feature is optional, the simplest fix is to skip the processing when the failure tag is empty. Also added a test, and the corresponding input file is generated from a reporter within our codebase.
This commit is contained in:
parent
074fe2cd27
commit
a91086638b
3 changed files with 27 additions and 4 deletions
|
|
@ -128,10 +128,13 @@ export class JavaJunitParser implements TestParser {
|
|||
let filePath
|
||||
let line
|
||||
|
||||
const src = this.exceptionThrowSource(details)
|
||||
if (src) {
|
||||
filePath = src.filePath
|
||||
line = src.line
|
||||
if(details != null)
|
||||
{
|
||||
const src = this.exceptionThrowSource(details)
|
||||
if (src) {
|
||||
filePath = src.filePath
|
||||
line = src.line
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue