@testomatio/reporter 2.3.0 → 2.3.1-beta.1-dependency

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.
@@ -1,6 +1,6 @@
1
1
  export const dataStorage: DataStorage;
2
2
  declare class DataStorage {
3
- static "__#12@#instance": any;
3
+ static #instance: any;
4
4
  /**
5
5
  *
6
6
  * @returns {DataStorage}
package/lib/pipe/debug.js CHANGED
@@ -18,7 +18,7 @@ class DebugPipe {
18
18
  this.isEnabled = !!process.env.TESTOMATIO_DEBUG || !!process.env.DEBUG;
19
19
  if (this.isEnabled) {
20
20
  this.batch = {
21
- isEnabled: this.params.isBatchEnabled ?? !process.env.TESTOMATIO_DISABLE_BATCH_UPLOAD ?? true,
21
+ isEnabled: this.params.isBatchEnabled ?? !process.env.TESTOMATIO_DISABLE_BATCH_UPLOAD,
22
22
  intervalFunction: null,
23
23
  intervalTime: 5000,
24
24
  tests: [],
@@ -23,7 +23,7 @@ if (process.env.TESTOMATIO_RUN)
23
23
  class TestomatioPipe {
24
24
  constructor(params, store) {
25
25
  this.batch = {
26
- isEnabled: params?.isBatchEnabled ?? !process.env.TESTOMATIO_DISABLE_BATCH_UPLOAD ?? true,
26
+ isEnabled: params?.isBatchEnabled ?? !process.env.TESTOMATIO_DISABLE_BATCH_UPLOAD,
27
27
  intervalFunction: null, // will be created in createRun by setInterval function
28
28
  intervalTime: 5000, // how often tests are sent
29
29
  tests: [], // array of tests in batch
@@ -60,7 +60,7 @@ class TestomatioPipe {
60
60
  retry: constants_js_1.REPORTER_REQUEST_RETRIES.retriesPerRequest,
61
61
  retryDelay: constants_js_1.REPORTER_REQUEST_RETRIES.retryTimeout,
62
62
  httpMethodsToRetry: ['GET', 'PUT', 'HEAD', 'OPTIONS', 'DELETE', 'POST'],
63
- shouldRetry: (error) => {
63
+ shouldRetry: error => {
64
64
  if (!error.response)
65
65
  return false;
66
66
  switch (error.response?.status) {
@@ -73,8 +73,8 @@ class TestomatioPipe {
73
73
  break;
74
74
  }
75
75
  return error.response?.status >= 401; // Retry on 401+ and 5xx
76
- }
77
- }
76
+ },
77
+ },
78
78
  });
79
79
  this.isEnabled = true;
80
80
  // do not finish this run (for parallel testing)
@@ -171,7 +171,7 @@ class TestomatioPipe {
171
171
  method: 'PUT',
172
172
  url: `/api/reporter/${this.runId}`,
173
173
  data: runParams,
174
- responseType: 'json'
174
+ responseType: 'json',
175
175
  });
176
176
  if (resp.data.artifacts)
177
177
  (0, pipe_utils_js_1.setS3Credentials)(resp.data.artifacts);
@@ -184,7 +184,7 @@ class TestomatioPipe {
184
184
  url: '/api/reporter',
185
185
  data: runParams,
186
186
  maxContentLength: Infinity,
187
- responseType: 'json'
187
+ responseType: 'json',
188
188
  });
189
189
  this.runId = resp.data.uid;
190
190
  this.runUrl = `${this.url}/${resp.data.url.split('/').splice(3).join('/')}`;
@@ -241,15 +241,17 @@ class TestomatioPipe {
241
241
  }
242
242
  const json = json_cycle_1.default.stringify(data);
243
243
  debug('Adding test', json);
244
- return this.client.request({
244
+ return this.client
245
+ .request({
245
246
  method: 'POST',
246
247
  url: `/api/reporter/${this.runId}/testrun`,
247
248
  data: json,
248
249
  headers: {
249
250
  'Content-Type': 'application/json',
250
251
  },
251
- maxContentLength: Infinity
252
- }).catch(err => {
252
+ maxContentLength: Infinity,
253
+ })
254
+ .catch(err => {
253
255
  this.requestFailures++;
254
256
  this.notReportedTestsCount++;
255
257
  if (err.response) {
@@ -294,19 +296,21 @@ class TestomatioPipe {
294
296
  // get tests from batch and clear batch
295
297
  const testsToSend = this.batch.tests.splice(0);
296
298
  debug('📨 Batch upload', testsToSend.length, 'tests');
297
- return this.client.request({
299
+ return this.client
300
+ .request({
298
301
  method: 'POST',
299
302
  url: `/api/reporter/${this.runId}/testrun`,
300
303
  data: {
301
304
  api_key: this.apiKey,
302
305
  tests: testsToSend,
303
- batch_index: this.batch.batchIndex
306
+ batch_index: this.batch.batchIndex,
304
307
  },
305
308
  headers: {
306
309
  'Content-Type': 'application/json',
307
310
  },
308
- maxContentLength: Infinity
309
- }).catch(err => {
311
+ maxContentLength: Infinity,
312
+ })
313
+ .catch(err => {
310
314
  this.requestFailures++;
311
315
  this.notReportedTestsCount += testsToSend.length;
312
316
  if (err.response) {
@@ -394,7 +398,7 @@ class TestomatioPipe {
394
398
  status_event,
395
399
  detach: params.detach,
396
400
  tests: params.tests,
397
- }
401
+ },
398
402
  });
399
403
  if (this.runUrl) {
400
404
  console.log(constants_js_1.APP_PREFIX, '📊 Report Saved. Report URL:', picocolors_1.default.magenta(this.runUrl));
package/lib/reporter.d.ts CHANGED
@@ -5,7 +5,7 @@ export const artifact: (data: string | {
5
5
  }, context?: any) => void;
6
6
  export const log: (...args: any[]) => void;
7
7
  export const logger: {
8
- "__#13@#originalUserLogger": {
8
+ #originalUserLogger: {
9
9
  assert(condition?: boolean, ...data: any[]): void;
10
10
  assert(value: any, message?: string, ...optionalParams: any[]): void;
11
11
  clear(): void;
@@ -50,13 +50,13 @@ export const logger: {
50
50
  profile(label?: string): void;
51
51
  profileEnd(label?: string): void;
52
52
  };
53
- "__#13@#userLoggerWithOverridenMethods": any;
53
+ #userLoggerWithOverridenMethods: any;
54
54
  logLevel: string;
55
55
  step(strings: any, ...values: any[]): void;
56
56
  getLogs(context: string): string[];
57
- "__#13@#stringifyLogs"(...args: any[]): string;
57
+ #stringifyLogs(...args: any[]): string;
58
58
  _templateLiteralLog(strings: any, ...args: any[]): void;
59
- "__#13@#logWrapper"(argsArray: any, level: any): void;
59
+ #logWrapper(argsArray: any, level: any): void;
60
60
  assert(...args: any[]): void;
61
61
  debug(...args: any[]): void;
62
62
  error(...args: any[]): void;
@@ -81,7 +81,7 @@ export const linkTest: (...testIds: string[]) => void;
81
81
  export const linkJira: (...jiraIds: string[]) => void;
82
82
  declare namespace _default {
83
83
  let testomatioLogger: {
84
- "__#13@#originalUserLogger": {
84
+ #originalUserLogger: {
85
85
  assert(condition?: boolean, ...data: any[]): void;
86
86
  assert(value: any, message?: string, ...optionalParams: any[]): void;
87
87
  clear(): void;
@@ -126,13 +126,13 @@ declare namespace _default {
126
126
  profile(label?: string): void;
127
127
  profileEnd(label?: string): void;
128
128
  };
129
- "__#13@#userLoggerWithOverridenMethods": any;
129
+ #userLoggerWithOverridenMethods: any;
130
130
  logLevel: string;
131
131
  step(strings: any, ...values: any[]): void;
132
132
  getLogs(context: string): string[];
133
- "__#13@#stringifyLogs"(...args: any[]): string;
133
+ #stringifyLogs(...args: any[]): string;
134
134
  _templateLiteralLog(strings: any, ...args: any[]): void;
135
- "__#13@#logWrapper"(argsArray: any, level: any): void;
135
+ #logWrapper(argsArray: any, level: any): void;
136
136
  assert(...args: any[]): void;
137
137
  debug(...args: any[]): void;
138
138
  error(...args: any[]): void;
@@ -155,7 +155,7 @@ declare namespace _default {
155
155
  }, context?: any) => void;
156
156
  let log: (...args: any[]) => void;
157
157
  let logger: {
158
- "__#13@#originalUserLogger": {
158
+ #originalUserLogger: {
159
159
  assert(condition?: boolean, ...data: any[]): void;
160
160
  assert(value: any, message?: string, ...optionalParams: any[]): void;
161
161
  clear(): void;
@@ -200,13 +200,13 @@ declare namespace _default {
200
200
  profile(label?: string): void;
201
201
  profileEnd(label?: string): void;
202
202
  };
203
- "__#13@#userLoggerWithOverridenMethods": any;
203
+ #userLoggerWithOverridenMethods: any;
204
204
  logLevel: string;
205
205
  step(strings: any, ...values: any[]): void;
206
206
  getLogs(context: string): string[];
207
- "__#13@#stringifyLogs"(...args: any[]): string;
207
+ #stringifyLogs(...args: any[]): string;
208
208
  _templateLiteralLog(strings: any, ...args: any[]): void;
209
- "__#13@#logWrapper"(argsArray: any, level: any): void;
209
+ #logWrapper(argsArray: any, level: any): void;
210
210
  assert(...args: any[]): void;
211
211
  debug(...args: any[]): void;
212
212
  error(...args: any[]): void;
@@ -3,7 +3,7 @@ export const artifactStorage: ArtifactStorage;
3
3
  * Artifact storage is supposed to store file paths
4
4
  */
5
5
  declare class ArtifactStorage {
6
- static "__#14@#instance": any;
6
+ static #instance: any;
7
7
  /**
8
8
  * Singleton
9
9
  * @returns {ArtifactStorage}
@@ -1,6 +1,6 @@
1
1
  export const keyValueStorage: KeyValueStorage;
2
2
  declare class KeyValueStorage {
3
- static "__#15@#instance": any;
3
+ static #instance: any;
4
4
  /**
5
5
  *
6
6
  * @returns {KeyValueStorage}
@@ -1,6 +1,6 @@
1
1
  export const linkStorage: LinkStorage;
2
2
  declare class LinkStorage {
3
- static "__#16@#instance": any;
3
+ static #instance: any;
4
4
  /**
5
5
  *
6
6
  * @returns {LinkStorage}
@@ -5,7 +5,7 @@ export const logger: Logger;
5
5
  * Supports different syntaxes to satisfy any user preferences.
6
6
  */
7
7
  declare class Logger {
8
- static "__#13@#instance": any;
8
+ static #instance: any;
9
9
  /**
10
10
  *
11
11
  * @returns {Logger}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testomatio/reporter",
3
- "version": "2.3.0",
3
+ "version": "2.3.1-beta.1-dependency",
4
4
  "description": "Testomatio Reporter Client",
5
5
  "engines": {
6
6
  "node": ">=18"
@@ -10,13 +10,20 @@
10
10
  "author": "Michael Bodnarchuk <davert@testomat.io>,Koushik Mohan <koushikmohan1996@gmail.com>",
11
11
  "license": "MIT",
12
12
  "type": "module",
13
+ "overrides": {
14
+ "tmp": "0.2.4",
15
+ "external-editor": {
16
+ "tmp": "0.2.4"
17
+ },
18
+ "follow-redirects": "1.15.6",
19
+ "axios": "^1.7.0"
20
+ },
13
21
  "dependencies": {
14
22
  "@aws-sdk/client-s3": "^3.279.0",
15
23
  "@aws-sdk/lib-storage": "^3.279.0",
16
- "@cucumber/cucumber": "^10.9.0",
24
+ "@cucumber/cucumber": "^12.2.0",
17
25
  "@octokit/rest": "^21.1.1",
18
26
  "aws-sdk": "^2.1072.0",
19
- "gaxios": ">=6.0 || >=7.0.0-rc.4 || <8",
20
27
  "callsite-record": "^4.1.4",
21
28
  "commander": "^12",
22
29
  "cross-spawn": "^7.0.3",
@@ -26,6 +33,7 @@
26
33
  "fast-xml-parser": "^4.4.1",
27
34
  "file-url": "3.0.0",
28
35
  "filesize": "^10.1.6",
36
+ "gaxios": ">=6.0 || >=7.0.0-rc.4 || <8",
29
37
  "glob": "^10.3",
30
38
  "handlebars": "^4.7.8",
31
39
  "has-flag": "^5.0.1",
@@ -85,7 +93,7 @@
85
93
  "@types/mocha": "^10.0.7",
86
94
  "@wdio/reporter": "^7.16.13",
87
95
  "chai": "^4.3.6",
88
- "codeceptjs": "^3.6.5",
96
+ "codeceptjs": "^3.7.4",
89
97
  "cucumber": "^6.0.7",
90
98
  "eslint": "^9.24.0",
91
99
  "eslint-config-prettier": "^8.3.0",
@@ -93,13 +101,13 @@
93
101
  "jasmine": "^5.2.0",
94
102
  "jest": "^27.4.7",
95
103
  "jsdom": "^22.1.0",
96
- "mocha": "^9.2.0",
104
+ "mocha": "^11.7.2",
97
105
  "mock-http-server": "^1.4.5",
98
106
  "pino": "^8.15.0",
99
107
  "prettier": "^3.2.5",
100
108
  "puppeteer": "^22.15.0",
101
109
  "typescript": "^5.5.4",
102
- "vitest": "^1.6.0"
110
+ "vitest": "^3.2.4"
103
111
  },
104
112
  "bin": {
105
113
  "@testomatio/reporter": "./lib/bin/cli.js",
@@ -113,27 +121,28 @@
113
121
  "require": "./lib/reporter.js",
114
122
  "types": "./types/types.d.ts"
115
123
  },
116
- "./lib/adapter/codecept/codecept.js": "./lib/adapter/codecept.js",
117
- "./lib/adapter/codecept": "./lib/adapter/codecept.js",
118
- "./codecept": "./lib/adapter/codecept.js",
119
- "./lib/adapter/cucumber/cucumber.js": "./lib/adapter/cucumber/current.js",
120
- "./cucumber": "./lib/adapter/cucumber/current.js",
121
- "./lib/adapter/cypress-plugin": "./lib/adapter/cypress-plugin/index.js",
122
- "./cypress-plugin": "./lib/adapter/cypress-plugin/index.js",
123
- "./cypress": "./lib/adapter/cypress-plugin/index.js",
124
- "./lib/adapter/jasmine.js": "./lib/adapter/jasmine.js",
125
- "./jasmine": "./lib/adapter/jasmine.js",
126
- "./lib/adapter/jest.js": "./lib/adapter/jest.js",
127
- "./jest": "./lib/adapter/jest.js",
128
- "./lib/adapter/mocha/mocha.js": "./lib/adapter/mocha.js",
129
- "./mocha": "./lib/adapter/mocha.js",
130
- "./lib/adapter/playwright.js": "./lib/adapter/playwright.js",
131
- "./nightwatch": "./lib/adapter/nightwatch.js",
132
- "./playwright": "./lib/adapter/playwright.js",
133
- "./vitest": "./lib/adapter/vitest.js",
134
- "./lib/adapter/webdriver.js": "./lib/adapter/webdriver.js",
135
- "./lib/adapter/webdriver": "./lib/adapter/webdriver.js",
136
- "./webdriver": "./lib/adapter/webdriver.js",
137
- "./wdio": "./lib/adapter/webdriver.js"
124
+ "exports": {
125
+ ".": {
126
+ "import": "./src/reporter.js",
127
+ "require": "./lib/reporter.js",
128
+ "types": "./types/types.d.ts"
129
+ },
130
+ "./cypress-plugin": "./lib/adapter/cypress-plugin/index.js",
131
+ "./cypress": "./lib/adapter/cypress-plugin/index.js",
132
+ "./lib/adapter/jasmine.js": "./lib/adapter/jasmine.js",
133
+ "./jasmine": "./lib/adapter/jasmine.js",
134
+ "./lib/adapter/jest.js": "./lib/adapter/jest.js",
135
+ "./jest": "./lib/adapter/jest.js",
136
+ "./lib/adapter/mocha/mocha.js": "./lib/adapter/mocha.js",
137
+ "./mocha": "./lib/adapter/mocha.js",
138
+ "./lib/adapter/playwright.js": "./lib/adapter/playwright.js",
139
+ "./nightwatch": "./lib/adapter/nightwatch.js",
140
+ "./playwright": "./lib/adapter/playwright.js",
141
+ "./vitest": "./lib/adapter/vitest.js",
142
+ "./lib/adapter/webdriver.js": "./lib/adapter/webdriver.js",
143
+ "./lib/adapter/webdriver": "./lib/adapter/webdriver.js",
144
+ "./webdriver": "./lib/adapter/webdriver.js",
145
+ "./wdio": "./lib/adapter/webdriver.js"
146
+ }
138
147
  }
139
148
  }
package/src/pipe/debug.js CHANGED
@@ -15,7 +15,7 @@ export class DebugPipe {
15
15
  this.isEnabled = !!process.env.TESTOMATIO_DEBUG || !!process.env.DEBUG;
16
16
  if (this.isEnabled) {
17
17
  this.batch = {
18
- isEnabled: this.params.isBatchEnabled ?? !process.env.TESTOMATIO_DISABLE_BATCH_UPLOAD ?? true,
18
+ isEnabled: this.params.isBatchEnabled ?? !process.env.TESTOMATIO_DISABLE_BATCH_UPLOAD,
19
19
  intervalFunction: null,
20
20
  intervalTime: 5000,
21
21
  tests: [],
@@ -93,8 +93,7 @@ export class DebugPipe {
93
93
  const logData = { action: 'addTest', testId: data };
94
94
  if (this.store.runId) logData.runId = this.store.runId;
95
95
  this.logToFile(logData);
96
- }
97
- else this.batch.tests.push(data);
96
+ } else this.batch.tests.push(data);
98
97
 
99
98
  if (!this.batch.intervalFunction) await this.batchUpload();
100
99
  }
@@ -20,7 +20,7 @@ if (process.env.TESTOMATIO_RUN) process.env.runId = process.env.TESTOMATIO_RUN;
20
20
  class TestomatioPipe {
21
21
  constructor(params, store) {
22
22
  this.batch = {
23
- isEnabled: params?.isBatchEnabled ?? !process.env.TESTOMATIO_DISABLE_BATCH_UPLOAD ?? true,
23
+ isEnabled: params?.isBatchEnabled ?? !process.env.TESTOMATIO_DISABLE_BATCH_UPLOAD,
24
24
  intervalFunction: null, // will be created in createRun by setInterval function
25
25
  intervalTime: 5000, // how often tests are sent
26
26
  tests: [], // array of tests in batch
@@ -60,8 +60,8 @@ class TestomatioPipe {
60
60
  retryConfig: {
61
61
  retry: REPORTER_REQUEST_RETRIES.retriesPerRequest,
62
62
  retryDelay: REPORTER_REQUEST_RETRIES.retryTimeout,
63
- httpMethodsToRetry: ['GET','PUT','HEAD','OPTIONS','DELETE','POST'],
64
- shouldRetry: (error) => {
63
+ httpMethodsToRetry: ['GET', 'PUT', 'HEAD', 'OPTIONS', 'DELETE', 'POST'],
64
+ shouldRetry: error => {
65
65
  if (!error.response) return false;
66
66
  switch (error.response?.status) {
67
67
  case 400: // Bad request (probably wrong API key)
@@ -73,8 +73,8 @@ class TestomatioPipe {
73
73
  break;
74
74
  }
75
75
  return error.response?.status >= 401; // Retry on 401+ and 5xx
76
- }
77
- }
76
+ },
77
+ },
78
78
  });
79
79
 
80
80
  this.isEnabled = true;
@@ -186,7 +186,7 @@ class TestomatioPipe {
186
186
  method: 'PUT',
187
187
  url: `/api/reporter/${this.runId}`,
188
188
  data: runParams,
189
- responseType: 'json'
189
+ responseType: 'json',
190
190
  });
191
191
  if (resp.data.artifacts) setS3Credentials(resp.data.artifacts);
192
192
  return;
@@ -199,7 +199,7 @@ class TestomatioPipe {
199
199
  url: '/api/reporter',
200
200
  data: runParams,
201
201
  maxContentLength: Infinity,
202
- responseType: 'json'
202
+ responseType: 'json',
203
203
  });
204
204
 
205
205
  this.runId = resp.data.uid;
@@ -263,40 +263,42 @@ class TestomatioPipe {
263
263
 
264
264
  debug('Adding test', json);
265
265
 
266
- return this.client.request({
267
- method: 'POST',
268
- url: `/api/reporter/${this.runId}/testrun`,
269
- data: json,
270
- headers: {
271
- 'Content-Type': 'application/json',
272
- },
273
- maxContentLength: Infinity
274
- }).catch(err => {
275
- this.requestFailures++;
276
- this.notReportedTestsCount++;
277
- if (err.response) {
278
- if (err.response.status >= 400) {
279
- const responseData = err.response.data || { message: '' };
266
+ return this.client
267
+ .request({
268
+ method: 'POST',
269
+ url: `/api/reporter/${this.runId}/testrun`,
270
+ data: json,
271
+ headers: {
272
+ 'Content-Type': 'application/json',
273
+ },
274
+ maxContentLength: Infinity,
275
+ })
276
+ .catch(err => {
277
+ this.requestFailures++;
278
+ this.notReportedTestsCount++;
279
+ if (err.response) {
280
+ if (err.response.status >= 400) {
281
+ const responseData = err.response.data || { message: '' };
282
+ console.log(
283
+ APP_PREFIX,
284
+ pc.yellow(`Warning: ${responseData.message} (${err.response.status})`),
285
+ pc.gray(data?.title || ''),
286
+ );
287
+ if (err.response?.data?.message?.includes('could not be matched')) {
288
+ this.hasUnmatchedTests = true;
289
+ }
290
+ return;
291
+ }
280
292
  console.log(
281
293
  APP_PREFIX,
282
- pc.yellow(`Warning: ${responseData.message} (${err.response.status})`),
283
- pc.gray(data?.title || ''),
294
+ pc.yellow(`Warning: ${data?.title || ''} (${err.response?.status})`),
295
+ `Report couldn't be processed: ${err?.response?.data?.message}`,
284
296
  );
285
- if (err.response?.data?.message?.includes('could not be matched')) {
286
- this.hasUnmatchedTests = true;
287
- }
288
- return;
297
+ printCreateIssue(err);
298
+ } else {
299
+ console.log(APP_PREFIX, pc.blue(data?.title || ''), "Report couldn't be processed", err);
289
300
  }
290
- console.log(
291
- APP_PREFIX,
292
- pc.yellow(`Warning: ${data?.title || ''} (${err.response?.status})`),
293
- `Report couldn't be processed: ${err?.response?.data?.message}`,
294
- );
295
- printCreateIssue(err);
296
- } else {
297
- console.log(APP_PREFIX, pc.blue(data?.title || ''), "Report couldn't be processed", err);
298
- }
299
- });
301
+ });
300
302
  };
301
303
 
302
304
  /**
@@ -323,43 +325,42 @@ class TestomatioPipe {
323
325
  const testsToSend = this.batch.tests.splice(0);
324
326
  debug('📨 Batch upload', testsToSend.length, 'tests');
325
327
 
326
- return this.client.request({
327
- method: 'POST',
328
- url: `/api/reporter/${this.runId}/testrun`,
329
- data: {
330
- api_key: this.apiKey,
331
- tests: testsToSend,
332
- batch_index: this.batch.batchIndex
333
- },
334
- headers: {
335
- 'Content-Type': 'application/json',
336
- },
337
- maxContentLength: Infinity
338
- }).catch(err => {
339
- this.requestFailures++;
340
- this.notReportedTestsCount += testsToSend.length;
341
- if (err.response) {
342
- if (err.response.status >= 400) {
343
- const responseData = err.response.data || { message: '' };
328
+ return this.client
329
+ .request({
330
+ method: 'POST',
331
+ url: `/api/reporter/${this.runId}/testrun`,
332
+ data: {
333
+ api_key: this.apiKey,
334
+ tests: testsToSend,
335
+ batch_index: this.batch.batchIndex,
336
+ },
337
+ headers: {
338
+ 'Content-Type': 'application/json',
339
+ },
340
+ maxContentLength: Infinity,
341
+ })
342
+ .catch(err => {
343
+ this.requestFailures++;
344
+ this.notReportedTestsCount += testsToSend.length;
345
+ if (err.response) {
346
+ if (err.response.status >= 400) {
347
+ const responseData = err.response.data || { message: '' };
348
+ console.log(APP_PREFIX, pc.yellow(`Warning: ${responseData.message} (${err.response.status})`));
349
+ if (err.response?.data?.message?.includes('could not be matched')) {
350
+ this.hasUnmatchedTests = true;
351
+ }
352
+ return;
353
+ }
344
354
  console.log(
345
355
  APP_PREFIX,
346
- pc.yellow(`Warning: ${responseData.message} (${err.response.status})`),
356
+ pc.yellow(`Warning: (${err.response?.status})`),
357
+ `Report couldn't be processed: ${err?.response?.data?.message}`,
347
358
  );
348
- if (err.response?.data?.message?.includes('could not be matched')) {
349
- this.hasUnmatchedTests = true;
350
- }
351
- return;
359
+ printCreateIssue(err);
360
+ } else {
361
+ console.log(APP_PREFIX, "Report couldn't be processed", err);
352
362
  }
353
- console.log(
354
- APP_PREFIX,
355
- pc.yellow(`Warning: (${err.response?.status})`),
356
- `Report couldn't be processed: ${err?.response?.data?.message}`,
357
- );
358
- printCreateIssue(err);
359
- } else {
360
- console.log(APP_PREFIX, "Report couldn't be processed", err);
361
- }
362
- });
363
+ });
363
364
  };
364
365
 
365
366
  /**
@@ -385,9 +386,9 @@ class TestomatioPipe {
385
386
  else this.batch.tests.push(data);
386
387
 
387
388
  // if test is added after run which is already finished
388
- if (!this.batch.intervalFunction) uploading = this.#batchUpload();
389
+ if (!this.batch.intervalFunction) uploading = this.#batchUpload();
389
390
 
390
- // return promise to be able to wait for it
391
+ // return promise to be able to wait for it
391
392
  return uploading;
392
393
  }
393
394
 
@@ -436,7 +437,7 @@ class TestomatioPipe {
436
437
  status_event,
437
438
  detach: params.detach,
438
439
  tests: params.tests,
439
- }
440
+ },
440
441
  });
441
442
  if (this.runUrl) {
442
443
  console.log(APP_PREFIX, '📊 Report Saved. Report URL:', pc.magenta(this.runUrl));