@testomatio/reporter 1.1.0-beta.mocha-create.6 → 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.
@@ -27,7 +27,7 @@ function MochaReporter(runner, opts) {
27
27
 
28
28
  runner.on(EVENT_TEST_PASS, async test => {
29
29
  passes += 1;
30
-
30
+
31
31
  console.log(chalk.bold.green('✔'), test.fullTitle());
32
32
  const testId = parseTest(test.title);
33
33
 
@@ -84,8 +84,13 @@ 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);
92
+
93
+ if (root) console.trace(pathArr.filter(t => !!t));
89
94
  return pathArr.filter(t => !!t)[0];
90
95
  }
91
96
 
@@ -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.6",
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",