@testomatio/reporter 2.23.0 → 2.24.0

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.
@@ -77,6 +77,11 @@ class CoveragePipe {
77
77
  shouldRetry: (error) => {
78
78
  if (!error.response)
79
79
  return false;
80
+ // a custom shouldRetry replaces the built-in check, which is the only place
81
+ // where the retry limit is enforced, so the limit must be checked here as well
82
+ const { currentRetryAttempt = 0, retry } = error.config.retryConfig;
83
+ if (currentRetryAttempt >= retry)
84
+ return false;
80
85
  switch (error.response?.status) {
81
86
  case 400: // Bad request (probably wrong API key)
82
87
  case 404: // Test not matched
@@ -121,6 +121,11 @@ class TestomatioPipe {
121
121
  shouldRetry: error => {
122
122
  if (!error.response)
123
123
  return false;
124
+ // a custom shouldRetry replaces the built-in check, which is the only place
125
+ // where the retry limit is enforced, so the limit must be checked here as well
126
+ const { currentRetryAttempt = 0, retry } = error.config.retryConfig;
127
+ if (currentRetryAttempt >= retry)
128
+ return false;
124
129
  // no need to retry on 4xx errors, because they caused by user mistake, thus retrying will not help
125
130
  // 500 could also be related to both user or server mistake, but decided not to retry for now
126
131
  // this code code be changed to retry 500 too if needed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testomatio/reporter",
3
- "version": "2.23.0",
3
+ "version": "2.24.0",
4
4
  "description": "Testomatio Reporter Client",
5
5
  "engines": {
6
6
  "node": ">=22"
@@ -106,7 +106,7 @@
106
106
  "mock-http-server": "^1.4.5",
107
107
  "pino": "^8.15.0",
108
108
  "prettier": "^3.2.5",
109
- "puppeteer": "^22.15.0",
109
+ "puppeteer": "^25.18.1",
110
110
  "typescript": "^5.5.4",
111
111
  "vitest": "^5.0.5"
112
112
  },
@@ -84,6 +84,10 @@ class CoveragePipe { // or Changes for the future???
84
84
  httpMethodsToRetry: ['GET','PUT','HEAD','OPTIONS','DELETE','POST'],
85
85
  shouldRetry: (error) => {
86
86
  if (!error.response) return false;
87
+ // a custom shouldRetry replaces the built-in check, which is the only place
88
+ // where the retry limit is enforced, so the limit must be checked here as well
89
+ const { currentRetryAttempt = 0, retry } = error.config.retryConfig;
90
+ if (currentRetryAttempt >= retry) return false;
87
91
  switch (error.response?.status) {
88
92
  case 400: // Bad request (probably wrong API key)
89
93
  case 404: // Test not matched
@@ -139,6 +139,10 @@ class TestomatioPipe {
139
139
  httpMethodsToRetry: ['GET', 'PUT', 'HEAD', 'OPTIONS', 'DELETE', 'POST'],
140
140
  shouldRetry: error => {
141
141
  if (!error.response) return false;
142
+ // a custom shouldRetry replaces the built-in check, which is the only place
143
+ // where the retry limit is enforced, so the limit must be checked here as well
144
+ const { currentRetryAttempt = 0, retry } = error.config.retryConfig;
145
+ if (currentRetryAttempt >= retry) return false;
142
146
  // no need to retry on 4xx errors, because they caused by user mistake, thus retrying will not help
143
147
  // 500 could also be related to both user or server mistake, but decided not to retry for now
144
148
  // this code code be changed to retry 500 too if needed