@testomatio/reporter 0.6.6 → 0.6.7-beta.2

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.
Files changed (2) hide show
  1. package/lib/xmlReader.js +5 -1
  2. package/package.json +1 -1
package/lib/xmlReader.js CHANGED
@@ -27,6 +27,8 @@ const options = {
27
27
  parseTagValue: true,
28
28
  };
29
29
 
30
+ const reduceOptions = {};
31
+
30
32
  class XmlReader {
31
33
 
32
34
  constructor(opts = {}) {
@@ -78,6 +80,7 @@ class XmlReader {
78
80
  }
79
81
  const { testsuite, name, tests, failures, errors } = jsonSuite;
80
82
 
83
+ reduceOptions.preferClassname = this.stats.language === 'python';
81
84
  const resultTests = processTestSuite(testsuite);
82
85
 
83
86
  const hasFailures = resultTests.filter(t => t.status === 'failed').length > 0;
@@ -332,13 +335,14 @@ function reduceTestCases(prev, item) {
332
335
  run_time: testCaseItem.time,
333
336
  status: (testCaseItem.failure || testCaseItem.error) ? 'failed' : 'passed',
334
337
  title: testCaseItem.name,
335
- suite_title: item.name || testCaseItem.classname,
338
+ suite_title: reduceOptions.preferClassname ? testCaseItem.classname : item.name || testCaseItem.classname,
336
339
  })
337
340
  });
338
341
  return prev;
339
342
  }
340
343
 
341
344
  function processTestSuite(testsuite) {
345
+ if (!testsuite) return [];
342
346
  if (testsuite.testsuite) return processTestSuite(testsuite.testsuite)
343
347
 
344
348
  let suites = testsuite;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testomatio/reporter",
3
- "version": "0.6.6",
3
+ "version": "0.6.7-beta.2",
4
4
  "description": "Testomatio Reporter Client",
5
5
  "main": "./lib/reporter.js",
6
6
  "repository": "git@github.com:testomatio/reporter.git",