@testomatio/reporter 1.6.10 → 1.6.11

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/client.js CHANGED
@@ -179,12 +179,12 @@ class Client {
179
179
  }
180
180
  }
181
181
 
182
- if (value.length > 255) {
182
+ if (value?.length > 255) {
183
183
  value = value.substring(0, 255);
184
184
  debug(APP_PREFIX, `Meta info value "${value}" is too long, trimmed to 255 characters`);
185
185
  }
186
186
 
187
- if (key.length > 255) {
187
+ if (key?.length > 255) {
188
188
  const newKey = key.substring(0, 255);
189
189
  debug(APP_PREFIX, `Meta info key "${key}" is too long, trimmed to 255 characters`);
190
190
  return [newKey, value];
package/lib/xmlReader.js CHANGED
@@ -109,7 +109,7 @@ class XmlReader {
109
109
  }
110
110
 
111
111
  processJUnit(jsonSuite) {
112
- const { testsuite, name, tests, failures, errors, time } = jsonSuite;
112
+ const { testsuite, name, tests, failures, errors } = jsonSuite;
113
113
 
114
114
  reduceOptions.preferClassname = this.stats.language === 'python';
115
115
  const resultTests = processTestSuite(testsuite);
@@ -117,6 +117,8 @@ class XmlReader {
117
117
  const hasFailures = resultTests.filter(t => t.status === 'failed').length > 0;
118
118
  const status = failures > 0 || errors > 0 || hasFailures ? 'failed' : 'passed';
119
119
 
120
+ const time = testsuite.time || 0;
121
+ // debug('time', jsonSuite, time)
120
122
  if (time) {
121
123
  if (!this.stats.duration) this.stats.duration = 0;
122
124
  this.stats.duration += parseFloat(time);
@@ -419,19 +421,18 @@ class XmlReader {
419
421
  this.formatErrors();
420
422
  this.formatTests();
421
423
 
422
- debug('Uploading data', {
423
- ...this.stats,
424
- tests: this.tests,
425
- });
426
424
 
427
425
  const dataString = {
428
426
  ...this.stats,
429
427
  detach: this.requestParams.detach,
430
428
  api_key: this.requestParams.apiKey,
431
429
  status: 'finished',
430
+ duration: this.stats.duration,
432
431
  tests: this.tests,
433
432
  };
434
433
 
434
+ debug('Uploading data', dataString);
435
+
435
436
  return Promise.all(this.pipes.map(p => p.finishRun(dataString)));
436
437
  }
437
438
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testomatio/reporter",
3
- "version": "1.6.10",
3
+ "version": "1.6.11",
4
4
  "description": "Testomatio Reporter Client",
5
5
  "main": "./lib/reporter.js",
6
6
  "typings": "typings/index.d.ts",