diff --git a/.bacon.yml b/.bacon.yml index 7ef23d3fb..fae81de63 100644 --- a/.bacon.yml +++ b/.bacon.yml @@ -16,7 +16,7 @@ test_suites: - name: e2e script_path: /root/okta/okta-sdk-nodejs/scripts sort_order: '1' - timeout: '20' + timeout: '30' script_name: e2e criteria: MERGE queue_name: small diff --git a/package.json b/package.json index f5b2cfca1..743f3884b 100644 --- a/package.json +++ b/package.json @@ -34,10 +34,10 @@ "deep-copy": "^1.4.2", "form-data": "^4.0.0", "https-proxy-agent": "^5.0.0", - "isomorphic-fetch": "^3.0.0", "js-yaml": "^4.1.0", "lodash": "^4.17.20", "njwt": "^1.0.0", + "node-fetch": "^2.6.7", "parse-link-header": "^2.0.0", "rasha": "^1.2.5", "safe-flat": "^2.0.2" diff --git a/src/request-executor.js b/src/request-executor.js index 48b143b52..7a2877ab9 100644 --- a/src/request-executor.js +++ b/src/request-executor.js @@ -11,12 +11,12 @@ */ const EventEmitter = require('events').EventEmitter; -const isoFetch = require('isomorphic-fetch'); +const nodeFetch = require('node-fetch'); class RequestExecutor extends EventEmitter { fetch(request) { this.emit('request', request); - return isoFetch(request.url, request).then(response => { + return nodeFetch(request.url, request).then(response => { this.emit('response', response); return response; }); diff --git a/test/jest/request-executor.test.js b/test/jest/request-executor.test.js index 156d424ce..a13d1109d 100644 --- a/test/jest/request-executor.test.js +++ b/test/jest/request-executor.test.js @@ -1,16 +1,16 @@ const mockResponse = { status: 200 }; -jest.mock('isomorphic-fetch', () => { +jest.mock('node-fetch', () => { return jest.fn().mockReturnValue(Promise.resolve(mockResponse)); }); const RequestExecutor = require('../../src/request-executor'); -const isoFetch = require('isomorphic-fetch'); +const isoFetch = require('node-fetch'); describe('RequestExecutor', () => { describe('.fetch()', () => { - it('should delegate requests to isomorphic-fetch as (url, request)', async () => { + it('should delegate requests to node-fetch as (url, request)', async () => { const requestExecutor = new RequestExecutor(); const request = { url: '/foo' }; await requestExecutor.fetch(request); diff --git a/yarn.lock b/yarn.lock index 4f43cb2b1..e135586fe 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2380,14 +2380,6 @@ isexe@^2.0.0: resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= -isomorphic-fetch@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-3.0.0.tgz#0267b005049046d2421207215d45d6a262b8b8b4" - integrity sha512-qvUtwJ3j6qwsF3jLxkZ72qCgjMysPzDfeV240JHiGZsANBYd+EEuu35v7dfrJ9Up0Ak07D7GGSkGhCHTqg/5wA== - dependencies: - node-fetch "^2.6.1" - whatwg-fetch "^3.4.1" - istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.0.0-alpha.1: version "3.0.0" resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.0.tgz#f5944a37c70b550b02a78a5c3b2055b280cec8ec" @@ -3381,7 +3373,7 @@ njwt@^1.0.0: ecdsa-sig-formatter "^1.0.5" uuid "^3.3.2" -node-fetch@^2.6.0, node-fetch@^2.6.1, node-fetch@^2.6.7: +node-fetch@^2.6.0, node-fetch@^2.6.7: version "2.6.7" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad" integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== @@ -4479,11 +4471,6 @@ whatwg-encoding@^1.0.5: dependencies: iconv-lite "0.4.24" -whatwg-fetch@^3.4.1: - version "3.6.2" - resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.6.2.tgz#dced24f37f2624ed0281725d51d0e2e3fe677f8c" - integrity sha512-bJlen0FcuU/0EMLrdbJ7zOnW6ITZLrZMIarMUVmdKtsGvZna8vxKYaexICWPfZ8qwf9fzNq+UEIZrnSaApt6RA== - whatwg-mimetype@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf"