@testomatio/reporter 2.6.2 → 2.6.4-beta.1

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.
@@ -80,16 +80,10 @@ class TestomatioPipe {
80
80
  shouldRetry: error => {
81
81
  if (!error.response)
82
82
  return false;
83
- switch (error.response?.status) {
84
- case 400: // Bad request (probably wrong API key)
85
- case 404: // Test not matched
86
- case 429: // Rate limit exceeded
87
- case 500: // Internal server error
88
- return false;
89
- default:
90
- break;
91
- }
92
- return error.response?.status >= 401; // Retry on 401+ and 5xx
83
+ // no need to retry on 4xx errors, because they caused by user mistake, thus retrying will not help
84
+ // 500 could also be related to both user or server mistake, but decided not to retry for now
85
+ // this code code be changed to retry 500 too if needed
86
+ return error.response?.status >= 501; // Retry only on server errors
93
87
  },
94
88
  },
95
89
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testomatio/reporter",
3
- "version": "2.6.2",
3
+ "version": "2.6.4-beta.1",
4
4
  "description": "Testomatio Reporter Client",
5
5
  "engines": {
6
6
  "node": ">=18"
@@ -110,10 +110,10 @@
110
110
  "vitest": "^1.6.0"
111
111
  },
112
112
  "bin": {
113
- "testomatio/reporter": "./lib/bin/cli.js",
114
- "report-xml": "./lib/bin/reportXml.js",
115
- "start-test-run": "./lib/bin/startTest.js",
116
- "upload-artifacts": "./lib/bin/uploadArtifacts.js"
113
+ "testomatio/reporter": "./src/bin/cli.js",
114
+ "report-xml": "./src/bin/reportXml.js",
115
+ "start-test-run": "./src/bin/startTest.js",
116
+ "upload-artifacts": "./src/bin/uploadArtifacts.js"
117
117
  },
118
118
  "exports": {
119
119
  ".": {
@@ -87,16 +87,10 @@ class TestomatioPipe {
87
87
  httpMethodsToRetry: ['GET', 'PUT', 'HEAD', 'OPTIONS', 'DELETE', 'POST'],
88
88
  shouldRetry: error => {
89
89
  if (!error.response) return false;
90
- switch (error.response?.status) {
91
- case 400: // Bad request (probably wrong API key)
92
- case 404: // Test not matched
93
- case 429: // Rate limit exceeded
94
- case 500: // Internal server error
95
- return false;
96
- default:
97
- break;
98
- }
99
- return error.response?.status >= 401; // Retry on 401+ and 5xx
90
+ // no need to retry on 4xx errors, because they caused by user mistake, thus retrying will not help
91
+ // 500 could also be related to both user or server mistake, but decided not to retry for now
92
+ // this code code be changed to retry 500 too if needed
93
+ return error.response?.status >= 501; // Retry only on server errors
100
94
  },
101
95
  },
102
96
  });