@testomatio/reporter 1.0.1 → 1.0.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.
- package/lib/client.js +16 -14
- package/lib/util.js +2 -0
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -7,7 +7,6 @@ const { randomUUID } = require('crypto');
|
|
|
7
7
|
const upload = require('./fileUploader');
|
|
8
8
|
const { APP_PREFIX } = require('./constants');
|
|
9
9
|
const pipesFactory = require('./pipe');
|
|
10
|
-
const logger = require('./logger');
|
|
11
10
|
|
|
12
11
|
/**
|
|
13
12
|
* @typedef {import('../types').TestData} TestData
|
|
@@ -39,7 +38,7 @@ class Client {
|
|
|
39
38
|
*/
|
|
40
39
|
createRun() {
|
|
41
40
|
// all pipes disabled, skipping
|
|
42
|
-
if (!this.pipes
|
|
41
|
+
if (!this.pipes?.filter(p => p.isEnabled).length) return Promise.resolve();
|
|
43
42
|
|
|
44
43
|
const runParams = {
|
|
45
44
|
title: this.title,
|
|
@@ -68,7 +67,7 @@ class Client {
|
|
|
68
67
|
*/
|
|
69
68
|
async addTestRun(status, testData, storeArtifacts = []) {
|
|
70
69
|
// all pipes disabled, skipping
|
|
71
|
-
if (!this.pipes?.filter(p => p.isEnabled).length) return;
|
|
70
|
+
if (!this.pipes?.filter(p => p.isEnabled).length) return [];
|
|
72
71
|
|
|
73
72
|
if (!testData)
|
|
74
73
|
testData = {
|
|
@@ -103,6 +102,7 @@ class Client {
|
|
|
103
102
|
stack = this.formatSteps(stack, steps);
|
|
104
103
|
}
|
|
105
104
|
|
|
105
|
+
const logger = require('./logger');
|
|
106
106
|
const testLogs = logger.getLogs(test_id);
|
|
107
107
|
debug(`Test logs for ${test_id}:\n`, testLogs);
|
|
108
108
|
if (stack) stack += '\n\n';
|
|
@@ -150,17 +150,19 @@ class Client {
|
|
|
150
150
|
artifacts,
|
|
151
151
|
};
|
|
152
152
|
|
|
153
|
-
this.queue = this.queue
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
153
|
+
this.queue = this.queue.then(() =>
|
|
154
|
+
Promise.all(
|
|
155
|
+
this.pipes.map(async p => {
|
|
156
|
+
try {
|
|
157
|
+
const result = await p.addTest(data);
|
|
158
|
+
return { pipe: p.toString(), result };
|
|
159
|
+
} catch (err) {
|
|
160
|
+
console.log(APP_PREFIX, p.toString(), err);
|
|
161
|
+
}
|
|
162
|
+
}),
|
|
163
|
+
),
|
|
164
|
+
);
|
|
165
|
+
|
|
164
166
|
return this.queue;
|
|
165
167
|
}
|
|
166
168
|
|
package/lib/util.js
CHANGED