@testomatio/reporter 1.1.0-beta.mocha-create.7 → 1.1.0-beta.mocha-create.8

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.
@@ -84,9 +84,14 @@ Mocha.utils.inherits(MochaReporter, Mocha.reporters.Spec);
84
84
  module.exports = MochaReporter;
85
85
 
86
86
  function getSuiteTitle(test, pathArr = []) {
87
+ let root = pathArr.length === 0;
88
+
89
+ if (test.parent.parent) getSuiteTitle(test.parent, pathArr);
90
+
87
91
  pathArr.push(test.parent.title);
88
- if (test.parent.parent) getSuiteTitle(test.parent, pathArr);
89
- return pathArr.reverse().filter(t => !!t)[0];
92
+
93
+ if (root) console.trace(pathArr.filter(t => !!t));
94
+ return pathArr.filter(t => !!t)[0];
90
95
  }
91
96
 
92
97
  function getFile(test) {
@@ -94,5 +99,6 @@ function getFile(test) {
94
99
  }
95
100
 
96
101
  function getTestName(test) {
97
- return test.fullTitle();
102
+ if (process.env.TESTOMATIO_CREATE === 'fulltitle') return test.fullTitle();
103
+ return test.title;
98
104
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testomatio/reporter",
3
- "version": "1.1.0-beta.mocha-create.7",
3
+ "version": "1.1.0-beta.mocha-create.8",
4
4
  "description": "Testomatio Reporter Client",
5
5
  "main": "./lib/reporter.js",
6
6
  "typings": "typings/index.d.ts",