Skip to content

Commit caaee3b

Browse files
committed
fix: update eslint-config, fix eslint test issues
1 parent 700ed94 commit caaee3b

File tree

3 files changed

+38
-27
lines changed

3 files changed

+38
-27
lines changed

.eslintrc.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
11
{
2-
"extends": ["@adobe/eslint-config-aio-lib-config"]
2+
"extends": [
3+
"@adobe/eslint-config-aio-lib-config"
4+
],
5+
"rules": {
6+
"jsdoc/tag-lines": [
7+
"error",
8+
"never",
9+
{
10+
"startLines": null
11+
}
12+
]
13+
}
314
}

package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,18 @@
2323
"description": "Adobe I/O Lib Core Networking",
2424
"devDependencies": {
2525
"@adobe/aio-lib-test-proxy": "^1.0.0",
26-
"@adobe/eslint-config-aio-lib-config": "^2.0.0",
26+
"@adobe/eslint-config-aio-lib-config": "^2.0.1",
2727
"babel-runtime": "^6.26.0",
2828
"dotenv": "^16.3.1",
2929
"eol": "^0.9.1",
30-
"eslint": "^8.17.0",
31-
"eslint-config-standard": "^17.0.0",
32-
"eslint-plugin-import": "^2.26.0",
33-
"eslint-plugin-jest": "^23.20.0",
34-
"eslint-plugin-jsdoc": "^37.9.7",
35-
"eslint-plugin-n": "^15.2.1",
30+
"eslint": "^8.47.0",
31+
"eslint-config-standard": "^17.1.0",
32+
"eslint-plugin-import": "^2.28.0",
33+
"eslint-plugin-jest": "^27.2.3",
34+
"eslint-plugin-jsdoc": "^42.0.0",
35+
"eslint-plugin-n": "^16.0.1",
3636
"eslint-plugin-node": "^11.1.0",
37-
"eslint-plugin-promise": "^6.0.0",
37+
"eslint-plugin-promise": "^6.1.1",
3838
"eslint-plugin-standard": "^5.0.0",
3939
"fetch-mock": "^9.0.0",
4040
"jest": "^29.5.0",
@@ -48,7 +48,7 @@
4848
"query-string": "^7.0.1",
4949
"stdout-stderr": "^0.1.9",
5050
"tsd-jsdoc": "^2.4.0",
51-
"typescript": "^4.7.3"
51+
"typescript": "^4.9.5"
5252
},
5353
"scripts": {
5454
"e2e": "jest --config e2e/jest.config.js",

test/HttpExponentialBackoff.test.js

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@ beforeEach(() => {
5656
jest.useRealTimers()
5757
})
5858

59-
test('test exponential backoff with success in first attempt without mock retryOn', async () => {
59+
test('exponential backoff with success in first attempt without mock retryOn', async () => {
6060
const result = await fetchClient.exponentialBackoff('https://abc.com/', { method: 'GET' })
6161
expect(result.status).toBe(200)
6262
})
6363

64-
test('test exponentialBackoff with no retries on 4xx errors without mock retryOn', async () => {
64+
test('exponentialBackoff with no retries on 4xx errors without mock retryOn', async () => {
6565
const retrySpy = jest.spyOn(fetchClient, '__getRetryOn')
6666
fetchMock.mockResponse('404 Not Found', {
6767
status: 404
@@ -72,7 +72,7 @@ test('test exponentialBackoff with no retries on 4xx errors without mock retryOn
7272
retrySpy.mockRestore()
7373
})
7474

75-
test('test exponentialBackoff with 3 retries on 5xx errors without mock retryOn', async () => {
75+
test('exponentialBackoff with 3 retries on 5xx errors without mock retryOn', async () => {
7676
const retrySpy = jest.spyOn(fetchClient, '__getRetryOn')
7777
fetchMock.mockResponse('500 Internal Server Error', {
7878
status: 500
@@ -83,7 +83,7 @@ test('test exponentialBackoff with 3 retries on 5xx errors without mock retryOn'
8383
retrySpy.mockRestore()
8484
})
8585

86-
test('test exponential backoff with success in first attempt', async () => {
86+
test('exponential backoff with success in first attempt', async () => {
8787
const mockDefaultFn = __testRetryOnHelper(3)
8888
const retrySpy = jest.spyOn(fetchClient, '__getRetryOn').mockImplementation((retries) => {
8989
return mockDefaultFn
@@ -98,7 +98,7 @@ test('test exponential backoff with success in first attempt', async () => {
9898
retrySpy.mockRestore()
9999
})
100100

101-
test('test exponentialBackoff with no retries on 4xx errors and default retry strategy', async () => {
101+
test('exponentialBackoff with no retries on 4xx errors and default retry strategy', async () => {
102102
const mockDefaultFn = __testRetryOnHelper(3)
103103
const retrySpy = jest.spyOn(fetchClient, '__getRetryOn').mockImplementation((retries) => {
104104
return mockDefaultFn
@@ -113,7 +113,7 @@ test('test exponentialBackoff with no retries on 4xx errors and default retry st
113113
retrySpy.mockRestore()
114114
})
115115

116-
test('test exponentialBackoff with 3 retries on 429 errors and default retry strategy', async () => {
116+
test('exponentialBackoff with 3 retries on 429 errors and default retry strategy', async () => {
117117
const mockDefaultFn = __testRetryOnHelper(3)
118118
const retrySpy = jest.spyOn(fetchClient, '__getRetryOn').mockImplementation((retries) => mockDefaultFn)
119119
fetchMock.mockResponse('429 Too many requests', {
@@ -126,7 +126,7 @@ test('test exponentialBackoff with 3 retries on 429 errors and default retry str
126126
retrySpy.mockRestore()
127127
})
128128

129-
test('test exponentialBackoff with 3 retries on 5xx errors and default retry strategy', async () => {
129+
test('exponentialBackoff with 3 retries on 5xx errors and default retry strategy', async () => {
130130
const mockDefaultFn = __testRetryOnHelper(3)
131131
const retrySpy = jest.spyOn(fetchClient, '__getRetryOn').mockImplementation((retries) => {
132132
return mockDefaultFn
@@ -141,7 +141,7 @@ test('test exponentialBackoff with 3 retries on 5xx errors and default retry str
141141
retrySpy.mockRestore()
142142
})
143143

144-
test('test exponentialBackoff with 3 retries on errors with default retry strategy and date in Retry-After header', async () => {
144+
test('exponentialBackoff with 3 retries on errors with default retry strategy and date in Retry-After header', async () => {
145145
const spy = jest.spyOn(global.Date, 'now').mockImplementation(() => new Date('Mon, 13 Feb 2023 23:59:59 GMT'))
146146
const header = 'Tue, 14 Feb 2023 00:00:00 GMT'
147147
fetchMock.mockResponse('503 Service Unavailable', {
@@ -155,7 +155,7 @@ test('test exponentialBackoff with 3 retries on errors with default retry strate
155155
expect(spy).toHaveBeenCalledTimes(2)
156156
})
157157

158-
test('test exponential backoff with success in first attempt and custom retryOptions', async () => {
158+
test('exponential backoff with success in first attempt and custom retryOptions', async () => {
159159
const mockDefaultFn = __testRetryOnHelper(2)
160160
const retrySpy = jest.spyOn(fetchClient, '__getRetryOn').mockImplementation((retries) => {
161161
return mockDefaultFn
@@ -170,7 +170,7 @@ test('test exponential backoff with success in first attempt and custom retryOpt
170170
retrySpy.mockRestore()
171171
})
172172

173-
test('test exponentialBackoff with no retries on 4xx errors and custom retryOptions', async () => {
173+
test('exponentialBackoff with no retries on 4xx errors and custom retryOptions', async () => {
174174
const mockDefaultFn = __testRetryOnHelper(1)
175175
const retrySpy = jest.spyOn(fetchClient, '__getRetryOn').mockImplementation((retries) => {
176176
return mockDefaultFn
@@ -185,7 +185,7 @@ test('test exponentialBackoff with no retries on 4xx errors and custom retryOpti
185185
retrySpy.mockRestore()
186186
})
187187

188-
test('test exponentialBackoff with 3 retries on 5xx errors and custom retryOptions', async () => {
188+
test('exponentialBackoff with 3 retries on 5xx errors and custom retryOptions', async () => {
189189
const mockDefaultFn = __testRetryOnHelper(2)
190190
const retrySpy = jest.spyOn(fetchClient, '__getRetryOn').mockImplementation((retries) => {
191191
return mockDefaultFn
@@ -200,7 +200,7 @@ test('test exponentialBackoff with 3 retries on 5xx errors and custom retryOptio
200200
retrySpy.mockRestore()
201201
})
202202

203-
test('test exponential backoff with success in first attempt and custom retryOn', async () => {
203+
test('exponential backoff with success in first attempt and custom retryOn', async () => {
204204
const mockDefaultFn = __testRetryOnHelper(2, 399, 500)
205205
fetchMock.mockResponse('200 OK', {
206206
status: 200
@@ -210,7 +210,7 @@ test('test exponential backoff with success in first attempt and custom retryOn'
210210
expect(mockDefaultFn).toHaveBeenCalledTimes(1)
211211
})
212212

213-
test('test exponentialBackoff with no retries on 4xx errors and custom retryOn', async () => {
213+
test('exponentialBackoff with no retries on 4xx errors and custom retryOn', async () => {
214214
const mockDefaultFn = __testRetryOnHelper(2, 399, 500)
215215
fetchMock.mockResponse('404 Not Found', {
216216
status: 404
@@ -221,7 +221,7 @@ test('test exponentialBackoff with no retries on 4xx errors and custom retryOn',
221221
expect(mockDefaultFn).toHaveBeenCalledTimes(3)
222222
})
223223

224-
test('test exponentialBackoff with 3 retries on 5xx errors and custom retryOn', async () => {
224+
test('exponentialBackoff with 3 retries on 5xx errors and custom retryOn', async () => {
225225
const mockDefaultFn = __testRetryOnHelper(2, 399, 500)
226226
const retrySpy = jest.spyOn(fetchClient, '__getRetryOn')
227227
fetchMock.mockResponse('500 Internal Server Error', {
@@ -236,7 +236,7 @@ test('test exponentialBackoff with 3 retries on 5xx errors and custom retryOn',
236236
retrySpy.mockRestore()
237237
})
238238

239-
test('test exponentialBackoff with default 3 retries on 5xx errors and custom retryOn as array', async () => {
239+
test('exponentialBackoff with default 3 retries on 5xx errors and custom retryOn as array', async () => {
240240
const mockDefaultFn = [429, 500, 503]
241241
fetchMock.mockResponse('429 Too Many Requests', {
242242
status: 429
@@ -245,7 +245,7 @@ test('test exponentialBackoff with default 3 retries on 5xx errors and custom re
245245
expect(result.status).toBe(429)
246246
})
247247

248-
test('test exponentialBackoff with 3 retries on 5xx errors and custom retryDelay', async () => {
248+
test('exponentialBackoff with 3 retries on 5xx errors and custom retryDelay', async () => {
249249
const mockDefaultFn1 = __testRetryDelayHelper(100)
250250
fetchMock.mockResponse('503 Service Unavailable', {
251251
status: 503,
@@ -256,7 +256,7 @@ test('test exponentialBackoff with 3 retries on 5xx errors and custom retryDelay
256256
expect(mockDefaultFn1).toHaveBeenCalledTimes(2)
257257
})
258258

259-
test('test exponentialBackoff with no retries on 4xx errors and custom retryDelay', async () => {
259+
test('exponentialBackoff with no retries on 4xx errors and custom retryDelay', async () => {
260260
const mockDefaultFn = __testRetryDelayHelper(100)
261261
fetchMock.mockResponse('404 Not Found', {
262262
status: 404

0 commit comments

Comments
 (0)