Skip to content

Commit 0057578

Browse files
committed
ESLint: Ignore presumed globals in Http tests
1 parent 554c920 commit 0057578

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/http.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export default function http(url, request = {}) {
3737
delete request.headers['Content-Type']
3838
}
3939

40-
return fetch(request.url, request).then((res) => {
40+
return fetch(request.url, request).then((res) => { // eslint-disable-line no-undef
4141
const serialized = self.serializeRes(res, url, request).then((_res) => {
4242
if (request.responseInterceptor) {
4343
_res = request.responseInterceptor(_res) || _res
@@ -128,7 +128,7 @@ export function serializeHeaders(headers = {}) {
128128

129129
function isFile(obj) {
130130
if (typeof File !== 'undefined') {
131-
return obj instanceof File
131+
return obj instanceof File // eslint-disable-line no-undef
132132
}
133133
return obj !== null && typeof obj === 'object' && typeof obj.pipe === 'function'
134134
}

test/http.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ describe('http', () => {
108108
// isomorphic-fetch exposes FetchAPI methods onto global
109109
require('isomorphic-fetch')
110110
expect(global.Headers).toBeA(Function)
111-
const headers = new Headers()
111+
const headers = new Headers() // eslint-disable-line no-undef
112112
headers.append('Authorization', 'Basic hoop-la')
113113
headers.append('Content-Type', 'application/oai.json')
114114

@@ -127,7 +127,7 @@ describe('http', () => {
127127
// isomorphic-fetch exposes FetchAPI methods onto global
128128
require('isomorphic-fetch')
129129
expect(global.Headers).toBeA(Function)
130-
const headers = new Headers()
130+
const headers = new Headers() // eslint-disable-line no-undef
131131
headers.append('Authorization', 'Basic hoop-la')
132132
headers.append('Authorization', 'Advanced hoop-la')
133133

@@ -145,7 +145,7 @@ describe('http', () => {
145145
// isomorphic-fetch exposes FetchAPI methods onto global
146146
require('isomorphic-fetch')
147147
expect(global.Headers).toBeA(Function)
148-
const headers = new Headers()
148+
const headers = new Headers() // eslint-disable-line no-undef
149149
headers.append('Authorization', 'Basic hoop-la')
150150
headers.append('Authorization', 'Advanced hoop-la')
151151
headers.append('Authorization', 'Super-Advanced hoop-la')
@@ -264,7 +264,7 @@ describe('http', () => {
264264

265265
const res = fetchMock.mock('http://swagger.io', {headers})
266266

267-
return fetch('http://swagger.io').then((_res) => {
267+
return fetch('http://swagger.io').then((_res) => { // eslint-disable-line no-undef
268268
return serializeRes(_res, 'https://swagger.io')
269269
}).then((resSerialize) => {
270270
expect(resSerialize.headers).toEqual({authorization: ['Basic hoop-la', 'Advanced hoop-la']})
@@ -279,12 +279,12 @@ describe('http', () => {
279279
const body = 'body data'
280280
const res = fetchMock.mock('http://swagger.io', {body, headers})
281281

282-
return fetch('http://swagger.io').then((_res) => {
282+
return fetch('http://swagger.io').then((_res) => { // eslint-disable-line no-undef
283283
return serializeRes(_res, 'https://swagger.io')
284284
}).then((resSerialize) => {
285285
expect(resSerialize.data).toBe(resSerialize.text)
286286
if (typeof Blob !== 'undefined') {
287-
expect(resSerialize.data).toBeA(Blob)
287+
expect(resSerialize.data).toBeA(Blob) // eslint-disable-line no-undef
288288
}
289289
else {
290290
expect(resSerialize.data).toBeA(Buffer)
@@ -301,7 +301,7 @@ describe('http', () => {
301301
const body = 'body data'
302302
const res = fetchMock.mock('http://swagger.io', {body, headers})
303303

304-
return fetch('http://swagger.io').then((_res) => {
304+
return fetch('http://swagger.io').then((_res) => { // eslint-disable-line no-undef
305305
return serializeRes(_res, 'https://swagger.io')
306306
}).then((resSerialize) => {
307307
expect(resSerialize.data).toBe(resSerialize.text)

0 commit comments

Comments
 (0)