diff --git a/package.json b/package.json index 0c073c3a1..c78f37ec2 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,7 @@ "btoa": "1.1.2", "deep-extend": "^0.4.1", "fast-json-patch": "^1.1.8", - "isomorphic-fetch": "2.2.1", + "fetch-everywhere": "^1.0.2", "isomorphic-form-data": "0.0.1", "js-yaml": "^3.8.1", "lodash": "4.16.2", diff --git a/src/http.js b/src/http.js index 0e0538be4..b53065d4d 100644 --- a/src/http.js +++ b/src/http.js @@ -1,4 +1,4 @@ -import fetch from 'isomorphic-fetch' +import fetch from 'fetch-everywhere' import qs from 'qs' import jsYaml from 'js-yaml' import assign from 'lodash/assign' diff --git a/src/specmap/lib/refs.js b/src/specmap/lib/refs.js index 9109ababf..cecdea1a5 100644 --- a/src/specmap/lib/refs.js +++ b/src/specmap/lib/refs.js @@ -1,4 +1,4 @@ -import fetch from 'isomorphic-fetch' +import fetch from 'fetch-everywhere' import url from 'url' import lib from '../lib' import createError from '../lib/create-error' diff --git a/test/http.js b/test/http.js index 78b7df97d..d9552f36a 100644 --- a/test/http.js +++ b/test/http.js @@ -102,8 +102,8 @@ describe('http', () => { describe('serializeHeaders', function () { it('should handle FetchAPI Headers object, which is iterable', function () { // Given - // isomorphic-fetch exposes FetchAPI methods onto global - require('isomorphic-fetch') + // fetch-everywhere exposes FetchAPI methods onto global + require('fetch-everywhere') expect(global.Headers).toBeA(Function) const headers = new Headers() headers.append('Authorization', 'Basic hoop-la') @@ -121,8 +121,8 @@ describe('http', () => { it('should handle two of the same headers', function () { // Given - // isomorphic-fetch exposes FetchAPI methods onto global - require('isomorphic-fetch') + // fetch-everywhere exposes FetchAPI methods onto global + require('fetch-everywhere') expect(global.Headers).toBeA(Function) const headers = new Headers() headers.append('Authorization', 'Basic hoop-la') @@ -139,8 +139,8 @@ describe('http', () => { it('should handle multiple headers', function () { // Given - // isomorphic-fetch exposes FetchAPI methods onto global - require('isomorphic-fetch') + // fetch-everywhere exposes FetchAPI methods onto global + require('fetch-everywhere') expect(global.Headers).toBeA(Function) const headers = new Headers() headers.append('Authorization', 'Basic hoop-la') diff --git a/test/index.js b/test/index.js index 11cb7fc6b..10fcb20e2 100644 --- a/test/index.js +++ b/test/index.js @@ -180,7 +180,7 @@ describe('constructor', () => { it('should serialize the response', function () { // Given - require('isomorphic-fetch') // To ensure global.Headers + require('fetch-everywhere') // To ensure global.Headers const xapp = xmock().get('https://swagger.io/one', function (req, res, next) { res.set('hi', 'ho') return res.send({me: true})