mirror of
https://github.com/dorny/test-reporter.git
synced 2026-02-04 04:05:22 -08:00
Merge pull request #115 from dorny/java-junit-handle-missing-time
Patch java-junit to handle missing time field
This commit is contained in:
4
dist/index.js
generated
vendored
4
dist/index.js
generated
vendored
@@ -888,6 +888,7 @@ class JavaJunitParser {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
getTestRunResult(filePath, junit) {
|
getTestRunResult(filePath, junit) {
|
||||||
|
var _a;
|
||||||
const suites = junit.testsuites.testsuite === undefined
|
const suites = junit.testsuites.testsuite === undefined
|
||||||
? []
|
? []
|
||||||
: junit.testsuites.testsuite.map(ts => {
|
: junit.testsuites.testsuite.map(ts => {
|
||||||
@@ -896,7 +897,8 @@ class JavaJunitParser {
|
|||||||
const sr = new test_results_1.TestSuiteResult(name, this.getGroups(ts), time);
|
const sr = new test_results_1.TestSuiteResult(name, this.getGroups(ts), time);
|
||||||
return sr;
|
return sr;
|
||||||
});
|
});
|
||||||
const time = parseFloat(junit.testsuites.$.time) * 1000;
|
const seconds = parseFloat((_a = junit.testsuites.$) === null || _a === void 0 ? void 0 : _a.time);
|
||||||
|
const time = isNaN(seconds) ? undefined : seconds * 1000;
|
||||||
return new test_results_1.TestRunResult(filePath, suites, time);
|
return new test_results_1.TestRunResult(filePath, suites, time);
|
||||||
}
|
}
|
||||||
getGroups(suite) {
|
getGroups(suite) {
|
||||||
|
|||||||
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
@@ -70,7 +70,8 @@ export class JavaJunitParser implements TestParser {
|
|||||||
return sr
|
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)
|
return new TestRunResult(filePath, suites, time)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user