@testomatio/reporter 2.3.7-beta.10-stack-artifacts → 2.3.7-beta.11-stack-artifacts

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 CHANGED
@@ -173,7 +173,7 @@ class Client {
173
173
  * @type {TestData}
174
174
  */
175
175
  const { rid, error = null, steps: originalSteps, title, suite_title, } = testData;
176
- const steps = originalSteps;
176
+ let steps = originalSteps;
177
177
  const uploadedFiles = [];
178
178
  const stackArtifactsEnabled = (0, utils_js_1.transformEnvVarToBoolean)(process.env.TESTOMATIO_STACK_ARTIFACTS);
179
179
  const { time = 0, example = null, files = [], filesBuffers = [], code = null, file, suite_id, test_id, timestamp, links, manuallyAttachedArtifacts, overwrite, tags, } = testData;
@@ -192,12 +192,10 @@ class Client {
192
192
  message = error?.message;
193
193
  }
194
194
  let fullLogs = this.formatLogs({ error: errorFormatted, steps, logs: testData.logs });
195
- if (stackArtifactsEnabled && status && (steps || testData.logs || error)) {
196
- const timestamp = +new Date;
197
- if (fullLogs && fullLogs.trim().length > 0) {
198
- uploadedFiles.push(this.uploader.uploadFileAsBuffer(Buffer.from(stripColors(fullLogs), 'utf8'), [this.runId, rid, `logs_${timestamp}.txt`]));
199
- }
195
+ if (stackArtifactsEnabled && fullLogs?.trim()?.length > 0) {
196
+ uploadedFiles.push(this.uploader.uploadFileAsBuffer(Buffer.from(stripColors(fullLogs), 'utf8'), [this.runId, rid, `logs_${+new Date}.log`]));
200
197
  fullLogs = '';
198
+ steps = null;
201
199
  }
202
200
  if (!this.pipes || !this.pipes.length)
203
201
  this.pipes = await (0, index_js_1.pipesFactory)(this.paramsForPipesFactory || {}, this.pipeStore);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testomatio/reporter",
3
- "version": "2.3.7-beta.10-stack-artifacts",
3
+ "version": "2.3.7-beta.11-stack-artifacts",
4
4
  "description": "Testomatio Reporter Client",
5
5
  "engines": {
6
6
  "node": ">=18"
package/src/client.js CHANGED
@@ -170,12 +170,12 @@ class Client {
170
170
  title,
171
171
  suite_title,
172
172
  } = testData;
173
- const steps = originalSteps;
173
+ let steps = originalSteps;
174
174
 
175
175
  const uploadedFiles = [];
176
176
  const stackArtifactsEnabled = transformEnvVarToBoolean(process.env.TESTOMATIO_STACK_ARTIFACTS);
177
177
 
178
-
178
+
179
179
  const {
180
180
  time = 0,
181
181
  example = null,
@@ -210,20 +210,18 @@ class Client {
210
210
 
211
211
  let fullLogs = this.formatLogs({ error: errorFormatted, steps, logs: testData.logs });
212
212
 
213
- if (stackArtifactsEnabled && status && (steps || testData.logs || error)) {
214
- const timestamp = +new Date;
215
- if (fullLogs && fullLogs.trim().length > 0) {
216
- uploadedFiles.push(
217
- this.uploader.uploadFileAsBuffer(
218
- Buffer.from(stripColors(fullLogs), 'utf8'),
219
- [this.runId, rid, `logs_${timestamp}.txt`]
220
- )
221
- );
222
- }
213
+ if (stackArtifactsEnabled && fullLogs?.trim()?.length > 0) {
214
+ uploadedFiles.push(
215
+ this.uploader.uploadFileAsBuffer(
216
+ Buffer.from(stripColors(fullLogs), 'utf8'),
217
+ [this.runId, rid, `logs_${+new Date}.log`]
218
+ )
219
+ );
223
220
  fullLogs = '';
221
+ steps = null;
224
222
  }
225
223
 
226
-
224
+
227
225
  if (!this.pipes || !this.pipes.length)
228
226
  this.pipes = await pipesFactory(this.paramsForPipesFactory || {}, this.pipeStore);
229
227