@testomatio/reporter 1.5.2 → 1.5.3-beta1-duation
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/pipe/testomatio.js +1 -0
- package/lib/xmlReader.js +7 -1
- package/package.json +1 -1
package/lib/pipe/testomatio.js
CHANGED
package/lib/xmlReader.js
CHANGED
|
@@ -107,7 +107,7 @@ class XmlReader {
|
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
processJUnit(jsonSuite) {
|
|
110
|
-
const { testsuite, name, tests, failures, errors } = jsonSuite;
|
|
110
|
+
const { testsuite, name, tests, failures, errors, time } = jsonSuite;
|
|
111
111
|
|
|
112
112
|
reduceOptions.preferClassname = this.stats.language === 'python';
|
|
113
113
|
const resultTests = processTestSuite(testsuite);
|
|
@@ -115,12 +115,18 @@ class XmlReader {
|
|
|
115
115
|
const hasFailures = resultTests.filter(t => t.status === 'failed').length > 0;
|
|
116
116
|
const status = failures > 0 || errors > 0 || hasFailures ? 'failed' : 'passed';
|
|
117
117
|
|
|
118
|
+
if (time) {
|
|
119
|
+
if (!this.stats.duration) this.stats.duration = 0;
|
|
120
|
+
this.stats.duration += parseFloat(time);
|
|
121
|
+
}
|
|
122
|
+
|
|
118
123
|
this.tests = this.tests.concat(resultTests);
|
|
119
124
|
|
|
120
125
|
return {
|
|
121
126
|
status,
|
|
122
127
|
create_tests: true,
|
|
123
128
|
name,
|
|
129
|
+
duration: parseFloat(time),
|
|
124
130
|
tests_count: parseInt(tests, 10),
|
|
125
131
|
passed_count: parseInt(tests, 10) - parseInt(failures, 10),
|
|
126
132
|
failed_count: parseInt(failures, 10),
|