@testomatio/reporter 1.1.0-beta.mocha-create.1 → 1.1.0-beta.mocha-create.3
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/adapter/mocha.js +8 -4
- package/lib/pipe/testomatio.js +2 -1
- package/package.json +1 -1
package/lib/adapter/mocha.js
CHANGED
|
@@ -30,11 +30,11 @@ function MochaReporter(runner, opts) {
|
|
|
30
30
|
|
|
31
31
|
console.log(chalk.bold.green('✔'), test.fullTitle());
|
|
32
32
|
const testId = parseTest(test.title);
|
|
33
|
-
|
|
33
|
+
|
|
34
34
|
client.addTestRun(STATUS.PASSED, {
|
|
35
35
|
test_id: testId,
|
|
36
36
|
suite_title: getSuiteTitle(test),
|
|
37
|
-
title: test
|
|
37
|
+
title: getTestName(test),
|
|
38
38
|
code: test.body.toString(),
|
|
39
39
|
file: getFile(test),
|
|
40
40
|
time: test.duration,
|
|
@@ -46,7 +46,7 @@ function MochaReporter(runner, opts) {
|
|
|
46
46
|
console.log('skip: %s', test.fullTitle());
|
|
47
47
|
const testId = parseTest(test.title);
|
|
48
48
|
client.addTestRun(STATUS.SKIPPED, {
|
|
49
|
-
title: test
|
|
49
|
+
title: getTestName(test),
|
|
50
50
|
suite_title: getSuiteTitle(test),
|
|
51
51
|
code: test.body.toString(),
|
|
52
52
|
file: getFile(test),
|
|
@@ -65,7 +65,7 @@ function MochaReporter(runner, opts) {
|
|
|
65
65
|
suite_title: getSuiteTitle(test),
|
|
66
66
|
file: getFile(test),
|
|
67
67
|
test_id: testId,
|
|
68
|
-
title: test
|
|
68
|
+
title: getTestName(test),
|
|
69
69
|
code: test.body.toString(),
|
|
70
70
|
time: test.duration,
|
|
71
71
|
});
|
|
@@ -91,4 +91,8 @@ function getSuiteTitle(test, pathArr = []) {
|
|
|
91
91
|
|
|
92
92
|
function getFile(test) {
|
|
93
93
|
return test.parent.file?.replace(process.cwd(), '');
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function getTestName(test) {
|
|
97
|
+
return test.fullTitle();
|
|
94
98
|
}
|
package/lib/pipe/testomatio.js
CHANGED
|
@@ -175,13 +175,14 @@ class TestomatioPipe {
|
|
|
175
175
|
* @returns
|
|
176
176
|
*/
|
|
177
177
|
addTest(data) {
|
|
178
|
-
debug('Adding test...');
|
|
179
178
|
if (!this.isEnabled) return;
|
|
180
179
|
if (!this.runId) return;
|
|
181
180
|
data.api_key = this.apiKey;
|
|
182
181
|
data.create = this.createNewTests;
|
|
183
182
|
const json = JsonCycle.stringify(data);
|
|
184
183
|
|
|
184
|
+
debug('Adding test', json);
|
|
185
|
+
|
|
185
186
|
return this.axios.post(`/api/reporter/${this.runId}/testrun`, json, {
|
|
186
187
|
maxContentLength: Infinity,
|
|
187
188
|
maxBodyLength: Infinity,
|