mirror of
https://github.com/dorny/test-reporter.git
synced 2025-12-15 13:57:09 +01:00
Merge pull request #399 from AnthonyBarbier/fix_junit_message
This commit is contained in:
commit
3c93b151a3
6 changed files with 25 additions and 8 deletions
|
|
@ -10,4 +10,5 @@ AcmeLibTests.AcmeLibTests
|
|||
✅ test_always_pass
|
||||
✅ test_always_skip
|
||||
❌ test_always_fail
|
||||
failed
|
||||
```
|
||||
|
|
@ -41,7 +41,7 @@ at java.lang.Thread.run(Thread.java:748)
|
|||
|
||||
",
|
||||
"line": 29,
|
||||
"message": undefined,
|
||||
"message": "java.lang.AssertionError: expected [1.2.1] but found [1.2.0]",
|
||||
"path": "pulsar-common/src/test/java/org/apache/pulsar/AddMissingPatchVersionTest.java",
|
||||
},
|
||||
"name": "testVersionStrings",
|
||||
|
|
@ -100,7 +100,7 @@ at java.lang.Thread.run(Thread.java:748)
|
|||
|
||||
",
|
||||
"line": 29,
|
||||
"message": undefined,
|
||||
"message": "java.lang.AssertionError: expected [1.2.1] but found [1.2.0]",
|
||||
"path": "pulsar-common/src/test/java/org/apache/pulsar/AddMissingPatchVersionTest.java",
|
||||
},
|
||||
"name": "testVersionStrings",
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ TestRunResult {
|
|||
"error": {
|
||||
"details": undefined,
|
||||
"line": undefined,
|
||||
"message": undefined,
|
||||
"message": "failed",
|
||||
"path": undefined,
|
||||
},
|
||||
"name": "test_always_fail",
|
||||
|
|
|
|||
11
dist/index.js
generated
vendored
11
dist/index.js
generated
vendored
|
|
@ -1178,7 +1178,7 @@ class JavaJunitParser {
|
|||
return 'success';
|
||||
}
|
||||
getTestCaseError(tc) {
|
||||
var _a;
|
||||
var _a, _b;
|
||||
if (!this.options.parseErrors) {
|
||||
return undefined;
|
||||
}
|
||||
|
|
@ -1198,11 +1198,18 @@ class JavaJunitParser {
|
|||
line = src.line;
|
||||
}
|
||||
}
|
||||
let message;
|
||||
if (typeof failure === 'object') {
|
||||
message = failure.$.message;
|
||||
if ((_b = failure.$) === null || _b === void 0 ? void 0 : _b.type) {
|
||||
message = failure.$.type + ': ' + message;
|
||||
}
|
||||
}
|
||||
return {
|
||||
path: filePath,
|
||||
line,
|
||||
details,
|
||||
message: typeof failure === 'object' ? failure.message : undefined
|
||||
message
|
||||
};
|
||||
}
|
||||
exceptionThrowSource(stackTrace) {
|
||||
|
|
|
|||
|
|
@ -137,11 +137,18 @@ export class JavaJunitParser implements TestParser {
|
|||
}
|
||||
}
|
||||
|
||||
let message
|
||||
if (typeof failure === 'object') {
|
||||
message = failure.$.message
|
||||
if (failure.$?.type) {
|
||||
message = failure.$.type + ': ' + message
|
||||
}
|
||||
}
|
||||
return {
|
||||
path: filePath,
|
||||
line,
|
||||
details,
|
||||
message: typeof failure === 'object' ? failure.message : undefined
|
||||
message
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -40,6 +40,8 @@ export interface TestCase {
|
|||
|
||||
export interface Failure {
|
||||
_: string
|
||||
type: string
|
||||
message: string
|
||||
$: {
|
||||
type?: string
|
||||
message: string
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue