Skip to content

Commit cd91285

Browse files
committed
small linter fixes
1 parent d995bda commit cd91285

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

packages/sdk-middleware-http/src/http.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export default function createHttpMiddleware({
9292
request: MiddlewareRequest,
9393
response: MiddlewareResponse
9494
) => {
95-
let abortController
95+
let abortController: any
9696
if (timeout || getAbortController || _abortController)
9797
// eslint-disable-next-line
9898
abortController = (getAbortController ? getAbortController(): null) || _abortController || new AbortController()
@@ -120,7 +120,7 @@ export default function createHttpMiddleware({
120120
if (credentialsMode) {
121121
fetchOptions.credentials = credentialsMode
122122
}
123-
if (timeout || abortController) {
123+
if (abortController) {
124124
fetchOptions.signal = abortController.signal
125125
}
126126
if (body) {

packages/sdk-middleware-http/test/http.spec.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ describe('Http', () => {
104104

105105
test('execute a get request with getAbortController timeout (success)', () => {
106106
expect.assertions(1)
107-
new Promise((resolve, reject) => {
107+
return new Promise((resolve, reject) => {
108108
const request = createTestRequest({
109109
uri: '/foo/bar',
110110
})
@@ -133,7 +133,8 @@ describe('Http', () => {
133133
.reply(200, { foo: 'bar' })
134134

135135
httpMiddleware(next)(request, response)
136-
})})
136+
})
137+
})
137138

138139
test('execute a get request with short timeout (fail)', () =>
139140
new Promise((resolve, reject) => {
@@ -198,7 +199,8 @@ describe('Http', () => {
198199
.reply(200, { foo: 'bar' })
199200

200201
httpMiddleware(next)(request, response)
201-
})})
202+
})
203+
})
202204

203205
test('execute a request with timeout and client re-use', () =>
204206
new Promise((resolve, reject) => {

0 commit comments

Comments
 (0)