diff --git a/package.json b/package.json index e670b09b4b9..69b9de4413a 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,6 @@ }, "devDependencies": { "@metamask/eslint-config": "^4.1.0", - "@types/fetch-mock": "^7.3.1", "@types/jest": "^22.2.3", "@types/node": "^10.1.4", "@types/sinon": "^4.3.3", @@ -72,10 +71,10 @@ "eslint-plugin-jest": "^23.6.0", "eslint-plugin-node": "^11.1.0", "ethjs-provider-http": "^0.1.6", - "fetch-mock": "^9.10.7", "jest": "^26.4.2", "jest-environment-jsdom": "^25.0.0", "lint-staged": "^6.1.0", + "nock": "^13.0.7", "prettier": "^2.1.1", "sinon": "^7.4.1", "ts-jest": "^26.3.0", diff --git a/tests/AssetsController.test.ts b/tests/AssetsController.test.ts index 852960f8bb0..c224945dfce 100644 --- a/tests/AssetsController.test.ts +++ b/tests/AssetsController.test.ts @@ -1,5 +1,5 @@ import { createSandbox } from 'sinon'; -import { getOnce } from 'fetch-mock'; +import * as nock from 'nock'; import AssetsController from '../src/assets/AssetsController'; import ComposableController from '../src/ComposableController'; import PreferencesController from '../src/user/PreferencesController'; @@ -10,7 +10,8 @@ const HttpProvider = require('ethjs-provider-http'); const KUDOSADDRESS = '0x2aea4add166ebf38b63d09a75de1a7b94aa24163'; const MAINNET_PROVIDER = new HttpProvider('https://mainnet.infura.io/v3/341eacb578dd44a1a049cbc5f6fd4035'); -const OPEN_SEA_API = 'https://api.opensea.io/api/v1/'; +const OPEN_SEA_HOST = 'https://api.opensea.io'; +const OPEN_SEA_PATH = '/api/v1'; describe('AssetsController', () => { let assetsController: AssetsController; @@ -27,94 +28,56 @@ describe('AssetsController', () => { new ComposableController([assetsController, assetsContract, network, preferences]); - getOnce( - `${OPEN_SEA_API}asset_contract/0xfoO`, - () => ({ - body: JSON.stringify({ - description: 'Description', - image_url: 'url', - name: 'Name', - symbol: 'FOO', - total_supply: 0, - }), - }), - { overwriteRoutes: true, method: 'GET' }, - ); - getOnce( - `${OPEN_SEA_API}asset_contract/0xFOu`, - () => ({ - body: JSON.stringify({ - description: 'Description', - image_url: 'url', - name: 'Name', - symbol: 'FOU', - total_supply: 10, - }), - }), - { overwriteRoutes: true, method: 'GET' }, - ); - getOnce( - `${OPEN_SEA_API}asset/0xfoO/1`, - () => ({ - body: JSON.stringify({ - description: 'Description', - image_original_url: 'url', - name: 'Name', - }), - }), - { overwriteRoutes: true, method: 'GET' }, - ); - getOnce( - `${OPEN_SEA_API}asset/0x2aEa4Add166EBf38b63d09a75dE1a7b94Aa24163/1203`, - () => ({ - body: JSON.stringify({ - description: 'Kudos Description', - image_original_url: 'Kudos url', - name: 'Kudos Name', - }), - }), - { overwriteRoutes: true, method: 'GET' }, - ); - getOnce( - 'https://ipfs.gitcoin.co:443/api/v0/cat/QmPmt6EAaioN78ECnW5oCL8v2YvVSpoBjLCjrXhhsAvoov', - () => ({ - body: JSON.stringify({ - image: 'Kudos Image', - name: 'Kudos Name', - }), - }), - { overwriteRoutes: true, method: 'GET' }, - ); - getOnce( - `${OPEN_SEA_API}asset/0x6EbeAf8e8E946F0716E6533A6f2cefc83f60e8Ab/798958393`, - () => ({ - throws: new TypeError('Failed to fetch'), - }), - { overwriteRoutes: true, method: 'GET' }, - ); - getOnce( - `${OPEN_SEA_API}asset_contract/0x6EbeAf8e8E946F0716E6533A6f2cefc83f60e8Ab`, - () => ({ - throws: new TypeError('Failed to fetch'), - }), - { overwriteRoutes: true, method: 'GET' }, - ); - getOnce( - `${OPEN_SEA_API}asset_contract/0x2aEa4Add166EBf38b63d09a75dE1a7b94Aa24163`, - () => ({ - body: JSON.stringify({ - description: 'Kudos Description', - image_url: 'Kudos url', - name: 'Kudos', - symbol: 'KDO', - total_supply: 10, - }), - }), - { overwriteRoutes: true, method: 'GET' }, - ); + nock(OPEN_SEA_HOST) + .get(`${OPEN_SEA_PATH}/asset_contract/0xfoO`) + .reply(200, { + description: 'Description', + image_url: 'url', + name: 'Name', + symbol: 'FOO', + total_supply: 0, + }) + .get(`${OPEN_SEA_PATH}/asset_contract/0xFOu`) + .reply(200, { + description: 'Description', + image_url: 'url', + name: 'Name', + symbol: 'FOU', + total_supply: 10, + }) + .get(`${OPEN_SEA_PATH}/asset/0xfoO/1`) + .reply(200, { + description: 'Description', + image_original_url: 'url', + name: 'Name', + }) + .get(`${OPEN_SEA_PATH}/asset/0x2aEa4Add166EBf38b63d09a75dE1a7b94Aa24163/1203`) + .reply(200, { + description: 'Kudos Description', + image_original_url: 'Kudos url', + name: 'Kudos Name', + }) + .get(`${OPEN_SEA_PATH}/asset/0x6EbeAf8e8E946F0716E6533A6f2cefc83f60e8Ab/798958393`) + .replyWithError(new TypeError('Failed to fetch')) + .get(`${OPEN_SEA_PATH}/asset_contract/0x6EbeAf8e8E946F0716E6533A6f2cefc83f60e8Ab`) + .replyWithError(new TypeError('Failed to fetch')) + .get(`${OPEN_SEA_PATH}/asset_contract/0x2aEa4Add166EBf38b63d09a75dE1a7b94Aa24163`) + .reply(200, { + description: 'Kudos Description', + image_url: 'Kudos url', + name: 'Kudos', + symbol: 'KDO', + total_supply: 10, + }); + + nock('https://ipfs.gitcoin.co:443').get('/api/v0/cat/QmPmt6EAaioN78ECnW5oCL8v2YvVSpoBjLCjrXhhsAvoov').reply(200, { + image: 'Kudos Image', + name: 'Kudos Name', + }); }); afterEach(() => { + nock.cleanAll(); sandbox.reset(); }); diff --git a/tests/AssetsDetectionController.test.ts b/tests/AssetsDetectionController.test.ts index 4818f882a11..eea7b30dbc7 100644 --- a/tests/AssetsDetectionController.test.ts +++ b/tests/AssetsDetectionController.test.ts @@ -1,5 +1,5 @@ import { createSandbox, stub } from 'sinon'; -import { getOnce, get } from 'fetch-mock'; +import * as nock from 'nock'; import { AssetsDetectionController } from '../src/assets/AssetsDetectionController'; import { NetworkController, NetworksChainId } from '../src/network/NetworkController'; import { PreferencesController } from '../src/user/PreferencesController'; @@ -13,7 +13,8 @@ const DEFAULT_INTERVAL = 180000; const MAINNET = 'mainnet'; const ROPSTEN = 'ropsten'; const TOKENS = [{ address: '0xfoO', symbol: 'bar', decimals: 2 }]; -const OPEN_SEA_API = 'https://api.opensea.io/api/v1/'; +const OPEN_SEA_HOST = 'https://api.opensea.io'; +const OPEN_SEA_PATH = '/api/v1'; describe('AssetsDetectionController', () => { let assetsDetection: AssetsDetectionController; @@ -32,139 +33,80 @@ describe('AssetsDetectionController', () => { new ComposableController([assets, assetsContract, assetsDetection, network, preferences]); - getOnce( - `${OPEN_SEA_API}asset_contract/0x1d963688FE2209A98dB35C67A041524822Cf04ff`, - () => ({ - body: JSON.stringify({ - description: 'Description', - image_url: 'url', - name: 'Name', - symbol: 'FOO', - total_supply: 0, - }), - }), - { overwriteRoutes: true, method: 'GET' }, - ); - - get( - `${OPEN_SEA_API}assets?owner=0x2&limit=300`, - () => ({ - body: JSON.stringify({ - assets: [ - { - asset_contract: { - address: '0x1d963688fe2209a98db35c67a041524822cf04ff', - }, - description: 'Description 2577', - image_original_url: 'image/2577.png', - name: 'ID 2577', - token_id: '2577', + nock(OPEN_SEA_HOST) + .get(`${OPEN_SEA_PATH}/assets?owner=0x2&limit=300`) + .reply(200, { + assets: [ + { + asset_contract: { + address: '0x1d963688fe2209a98db35c67a041524822cf04ff', }, - ], - }), - }), - { overwriteRoutes: true, method: 'GET' }, - ); + description: 'Description 2577', + image_original_url: 'image/2577.png', + name: 'ID 2577', + token_id: '2577', + }, + ], + }) + .persist(); - getOnce( - `${OPEN_SEA_API}assets?owner=0x1&limit=300`, - () => ({ - body: JSON.stringify({ - assets: [ - { - asset_contract: { - address: '0x1d963688fe2209a98db35c67a041524822cf04ff', - }, - description: 'Description 2577', - image_original_url: 'image/2577.png', - name: 'ID 2577', - token_id: '2577', + nock(OPEN_SEA_HOST) + .get(`${OPEN_SEA_PATH}/asset_contract/0x1d963688FE2209A98dB35C67A041524822Cf04ff`) + .reply(200, { + description: 'Description', + image_url: 'url', + name: 'Name', + symbol: 'FOO', + total_supply: 0, + }) + .get(`${OPEN_SEA_PATH}/asset_contract/0x1D963688FE2209A98db35c67A041524822cf04Hh`) + .reply(200, { + description: 'Description HH', + image_url: 'url HH', + name: 'Name HH', + symbol: 'HH', + total_supply: 10, + }) + .get(`${OPEN_SEA_PATH}/asset_contract/0x1d963688FE2209A98db35c67A041524822CF04gg`) + .replyWithError(new TypeError('Failed to fetch')) + .get(`${OPEN_SEA_PATH}/asset_contract/0x1D963688fe2209a98dB35c67a041524822Cf04ii`) + .replyWithError(new TypeError('Failed to fetch')) + .get(`${OPEN_SEA_PATH}/assets?owner=0x1&limit=300`) + .reply(200, { + assets: [ + { + asset_contract: { + address: '0x1d963688FE2209A98db35c67A041524822CF04gg', }, - { - asset_contract: { - address: '0x1d963688fe2209a98db35c67a041524822cf04ff', - }, - description: 'Description 2574', - image_original_url: 'image/2574.png', - name: 'ID 2574', - token_id: '2574', + description: 'Description 2577', + image_original_url: 'image/2577.png', + name: 'ID 2577', + token_id: '2577', + }, + { + asset_contract: { + address: '0x1d963688FE2209A98db35c67A041524822CF04ii', }, - ], - }), - }), - { overwriteRoutes: true, method: 'GET' }, - ); - - getOnce( - `${OPEN_SEA_API}asset_contract/0x1D963688FE2209A98db35c67A041524822cf04Hh`, - () => ({ - body: JSON.stringify({ - description: 'Description HH', - image_url: 'url HH', - name: 'Name HH', - symbol: 'HH', - total_supply: 10, - }), - }), - { overwriteRoutes: true, method: 'GET' }, - ); - - getOnce( - `${OPEN_SEA_API}asset_contract/0x1d963688FE2209A98db35c67A041524822CF04gg`, - () => ({ - throws: new TypeError('Failed to fetch'), - }), - { overwriteRoutes: true, method: 'GET' }, - ); - - getOnce( - `${OPEN_SEA_API}asset_contract/0x1D963688fe2209a98dB35c67a041524822Cf04ii`, - () => ({ - throws: new TypeError('Failed to fetch'), - }), - { overwriteRoutes: true, method: 'GET' }, - ); - - getOnce( - `${OPEN_SEA_API}assets?owner=0x1&limit=300`, - () => ({ - body: JSON.stringify({ - assets: [ - { - asset_contract: { - address: '0x1d963688FE2209A98db35c67A041524822CF04gg', - }, - description: 'Description 2577', - image_original_url: 'image/2577.png', - name: 'ID 2577', - token_id: '2577', + description: 'Description 2578', + image_original_url: 'image/2578.png', + name: 'ID 2578', + token_id: '2578', + }, + { + asset_contract: { + address: '0x1d963688FE2209A98db35c67A041524822CF04hh', }, - { - asset_contract: { - address: '0x1d963688FE2209A98db35c67A041524822CF04ii', - }, - description: 'Description 2578', - image_original_url: 'image/2578.png', - name: 'ID 2578', - token_id: '2578', - }, - { - asset_contract: { - address: '0x1d963688FE2209A98db35c67A041524822CF04hh', - }, - description: 'Description 2574', - image_original_url: 'image/2574.png', - name: 'ID 2574', - token_id: '2574', - }, - ], - }), - }), - { overwriteRoutes: true, method: 'GET' }, - ); + description: 'Description 2574', + image_original_url: 'image/2574.png', + name: 'ID 2574', + token_id: '2574', + }, + ], + }); }); afterEach(() => { + nock.cleanAll(); sandbox.reset(); }); @@ -321,71 +263,57 @@ describe('AssetsDetectionController', () => { expect(assets.state.collectibles).toEqual([collectibleHH2574]); expect(assets.state.collectibleContracts).toEqual([collectibleContractHH]); // During next call of assets detection, API succeds returning contract ending in gg information - getOnce( - `${OPEN_SEA_API}asset_contract/0x1d963688FE2209A98db35c67A041524822CF04gg`, - () => ({ - body: JSON.stringify({ - description: 'Description GG', - image_url: 'url GG', - name: 'Name GG', - symbol: 'GG', - total_supply: 10, - }), - }), - { overwriteRoutes: true, method: 'GET' }, - ); - getOnce( - `${OPEN_SEA_API}asset_contract/0x1D963688fe2209a98dB35c67a041524822Cf04ii`, - () => ({ - body: JSON.stringify({ - description: 'Description II', - image_url: 'url II', - name: 'Name II', - symbol: 'II', - total_supply: 10, - }), - }), - { overwriteRoutes: true, method: 'GET' }, - ); - - getOnce( - `${OPEN_SEA_API}assets?owner=0x1&limit=300`, - () => ({ - body: JSON.stringify({ - assets: [ - { - asset_contract: { - address: '0x1d963688FE2209A98db35c67A041524822CF04ii', - }, - description: 'Description 2577', - image_original_url: 'image/2577.png', - name: 'ID 2577', - token_id: '2577', + nock(OPEN_SEA_HOST) + .get(`${OPEN_SEA_PATH}/asset_contract/0x1d963688FE2209A98db35c67A041524822CF04gg`) + .reply(200, { + description: 'Description GG', + image_url: 'url GG', + name: 'Name GG', + symbol: 'GG', + total_supply: 10, + }) + .get(`${OPEN_SEA_PATH}/asset_contract/0x1D963688fe2209a98dB35c67a041524822Cf04ii`) + .reply(200, { + description: 'Description II', + image_url: 'url II', + name: 'Name II', + symbol: 'II', + total_supply: 10, + }) + .get(`${OPEN_SEA_PATH}/assets?owner=0x1&limit=300`) + .reply(200, { + assets: [ + { + asset_contract: { + address: '0x1d963688FE2209A98db35c67A041524822CF04ii', }, - { - asset_contract: { - address: '0x1D963688fe2209a98dB35c67a041524822Cf04gg', - }, - description: 'Description 2574', - image_original_url: 'image/2574.png', - name: 'ID 2574', - token_id: '2574', + description: 'Description 2577', + image_original_url: 'image/2577.png', + name: 'ID 2577', + token_id: '2577', + }, + { + asset_contract: { + address: '0x1D963688fe2209a98dB35c67a041524822Cf04gg', }, - { - asset_contract: { - address: '0x1d963688FE2209A98db35c67A041524822CF04hh', - }, - description: 'Description 2574', - image_original_url: 'image/2574.png', - name: 'ID 2574', - token_id: '2574', + description: 'Description 2574', + image_original_url: 'image/2574.png', + name: 'ID 2574', + token_id: '2574', + }, + { + asset_contract: { + address: '0x1d963688FE2209A98db35c67A041524822CF04hh', }, - ], - }), - }), - { overwriteRoutes: true, method: 'GET' }, - ); + description: 'Description 2574', + image_original_url: 'image/2574.png', + name: 'ID 2574', + token_id: '2574', + }, + ], + }); + // Now user should have respective collectibles await assetsDetection.detectCollectibles(); expect(assets.state.collectibleContracts).toEqual([ diff --git a/tests/CurrencyRateController.test.ts b/tests/CurrencyRateController.test.ts index 6de969e2ce3..7a25de1155b 100644 --- a/tests/CurrencyRateController.test.ts +++ b/tests/CurrencyRateController.test.ts @@ -1,19 +1,22 @@ import 'isomorphic-fetch'; import { stub } from 'sinon'; -import * as fetchMock from 'fetch-mock'; +import * as nock from 'nock'; import CurrencyRateController from '../src/assets/CurrencyRateController'; describe('CurrencyRateController', () => { beforeEach(() => { - fetchMock - .mock(/XYZ,USD/u, () => new Response(JSON.stringify({ XYZ: 123, USD: 456 }))) - .mock(/DEF,USD/u, () => new Response(JSON.stringify({ DEF: 123 }))) - .mock('*', () => new Response(JSON.stringify({ USD: 1337 }))) - .spy(); + nock(/.+/u) + .get(/XYZ,USD/u) + .reply(200, { XYZ: 123, USD: 456 }) + .get(/DEF,USD/u) + .reply(200, { DEF: 123 }) + .get(/.+/u) + .reply(200, { USD: 1337 }) + .persist(); }); afterEach(() => { - fetchMock.reset(); + nock.cleanAll(); }); it('should set default state', () => { @@ -103,17 +106,9 @@ describe('CurrencyRateController', () => { expect(controller.state.usdConversionRate).toEqual(456); }); - it('should use default base asset', async () => { - const nativeCurrency = 'FOO'; - const controller = new CurrencyRateController({ nativeCurrency }); - await controller.fetchExchangeRate('usd'); - expect(fetchMock.calls()[0][0]).toContain(nativeCurrency); - }); - it('should add usd rate to state fetches when configured', async () => { const controller = new CurrencyRateController({ includeUSDRate: true }); const result = await controller.fetchExchangeRate('xyz', 'FOO', true); - expect(fetchMock.calls()[0][0]).toContain('XYZ,USD'); expect(result.usdConversionRate).toEqual(456); expect(result.conversionRate).toEqual(123); }); diff --git a/tests/TokenRatesController.test.ts b/tests/TokenRatesController.test.ts index b4b140de7d5..24e31c89a71 100644 --- a/tests/TokenRatesController.test.ts +++ b/tests/TokenRatesController.test.ts @@ -1,5 +1,5 @@ import { stub } from 'sinon'; -import { get } from 'fetch-mock'; +import * as nock from 'nock'; import ComposableController from '../src/ComposableController'; import TokenRatesController, { Token } from '../src/assets/TokenRatesController'; import { AssetsController } from '../src/assets/AssetsController'; @@ -8,36 +8,30 @@ import { NetworkController } from '../src/network/NetworkController'; import { AssetsContractController } from '../src/assets/AssetsContractController'; import CurrencyRateController from '../src/assets/CurrencyRateController'; -const COINGECKO_API = 'https://api.coingecko.com/api/v3/simple/token_price/ethereum?'; +const COINGECKO_HOST = 'https://api.coingecko.com'; +const COINGECKO_PATH = '/api/v3/simple/token_price/ethereum'; describe('TokenRatesController', () => { beforeEach(() => { - get( - `${COINGECKO_API}contract_addresses=0x89d24A6b4CcB1B6fAA2625fE562bDD9a23260359,0xfoO&vs_currencies=eth`, - () => ({ - body: JSON.stringify({ '0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359': { eth: 0.00561045 } }), - }), - { overwriteRoutes: true, method: 'GET' }, - ); - get(`${COINGECKO_API}contract_addresses=0xfoO&vs_currencies=eth`, () => ({ body: '{}' }), { - method: 'GET', - overwriteRoutes: true, - }); - get(`${COINGECKO_API}contract_addresses=bar&vs_currencies=eth`, () => ({ body: '{}' }), { - method: 'GET', - overwriteRoutes: true, - }); - get(`${COINGECKO_API}contract_addresses=0xfoO&vs_currencies=gno`, () => ({ body: '{}' }), { - method: 'GET', - overwriteRoutes: true, - }); - get( - 'https://min-api.cryptocompare.com/data/price?fsym=ETH&tsyms=USD', - () => ({ - body: JSON.stringify({ USD: 179.63 }), - }), - { overwriteRoutes: true, method: 'GET' }, - ); + nock(COINGECKO_HOST) + .get(`${COINGECKO_PATH}?contract_addresses=0x89d24A6b4CcB1B6fAA2625fE562bDD9a23260359,0xfoO&vs_currencies=eth`) + .reply(200, { '0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359': { eth: 0.00561045 } }) + .get(`${COINGECKO_PATH}?contract_addresses=0xfoO&vs_currencies=eth`) + .reply(200, {}) + .get(`${COINGECKO_PATH}?contract_addresses=bar&vs_currencies=eth`) + .reply(200, {}) + .get(`${COINGECKO_PATH}?contract_addresses=0xfoO&vs_currencies=gno`) + .reply(200, {}) + .persist(); + + nock('https://min-api.cryptocompare.com') + .get('/data/price?fsym=ETH&tsyms=USD') + .reply(200, { USD: 179.63 }) + .persist(); + }); + + afterEach(() => { + nock.cleanAll(); }); it('should set default state', () => { diff --git a/tests/util.test.ts b/tests/util.test.ts index 12a27e6df16..2065f9cae62 100644 --- a/tests/util.test.ts +++ b/tests/util.test.ts @@ -1,5 +1,5 @@ import 'isomorphic-fetch'; -import * as fetchMock from 'fetch-mock'; +import * as nock from 'nock'; import * as util from '../src/util'; @@ -50,7 +50,7 @@ jest.mock('eth-query', () => describe('util', () => { beforeEach(() => { - fetchMock.reset(); + nock.cleanAll(); }); it('bNToHex', () => { @@ -510,9 +510,8 @@ describe('util', () => { describe('successfulFetch', () => { beforeEach(() => { - fetchMock - .mock(SOME_API, new Response(JSON.stringify({ foo: 'bar' }), { status: 200 })) - .mock(SOME_FAILING_API, new Response('response', { status: 500 })); + nock(SOME_API).get(/.+/u).reply(200, { foo: 'bar' }).persist(); + nock(SOME_FAILING_API).get(/.+/u).reply(500).persist(); }); it('should return successful fetch response', async () => { @@ -533,18 +532,8 @@ describe('util', () => { }); describe('timeoutFetch', () => { - const delay = (time: number) => { - return new Promise((resolve) => { - setTimeout(resolve, time); - }); - }; - beforeEach(() => { - fetchMock.mock(SOME_API, () => { - return delay(300).then(() => { - return JSON.stringify({}); - }); - }); + nock(SOME_API).get(/.+/u).delay(300).reply(200, {}).persist(); }); it('should fetch first if response is faster than timeout', async () => { diff --git a/yarn.lock b/yarn.lock index fb82235fbb7..7255b646224 100644 --- a/yarn.lock +++ b/yarn.lock @@ -772,11 +772,6 @@ resolved "https://registry.yarnpkg.com/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0" integrity sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ== -"@types/fetch-mock@^7.3.1": - version "7.3.1" - resolved "https://registry.yarnpkg.com/@types/fetch-mock/-/fetch-mock-7.3.1.tgz#df7421e8bcb351b430bfbfa5c52bb353826ac94f" - integrity sha512-2U4vZWHNbsbK7TRmizgr/pbKe0FKopcxu+hNDtIBDiM1wvrKRItybaYj7VQ6w/hZJStU/JxRiNi5ww4YDEvKbA== - "@types/graceful-fs@^4.1.2": version "4.1.3" resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.3.tgz#039af35fe26bec35003e8d86d2ee9c586354348f" @@ -1869,14 +1864,9 @@ copy-descriptor@^0.1.0: integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= core-js@^2.4.0: - version "2.6.9" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.9.tgz#6b4b214620c834152e179323727fc19741b084f2" - integrity sha512-HOpZf6eXmnl7la+cUdMnLvUxKNqLUzJvgIziQ0DiF3JwSImNphIqdGqzj6hIKyX04MmV0poclQ7+wjWvxQyR2A== - -core-js@^3.0.0: - version "3.6.5" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.6.5.tgz#7395dc273af37fb2e50e9bd3d9fe841285231d1a" - integrity sha512-vZVEEwZoIsI+vPEuoF9Iqf5H7/M3eeQqWlQnYa8FSKKePuYTf5MWnxb5SDAzCa60b3JBRS5g9b+Dq7b1y/RCrA== + version "2.6.12" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.12.tgz#d9333dfa7b065e347cc5682219d6f690859cc2ec" + integrity sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ== core-util-is@1.0.2, core-util-is@~1.0.0: version "1.0.2" @@ -3159,21 +3149,6 @@ fb-watchman@^2.0.0: dependencies: bser "^2.0.0" -fetch-mock@^9.10.7: - version "9.10.7" - resolved "https://registry.yarnpkg.com/fetch-mock/-/fetch-mock-9.10.7.tgz#9673717af181e1ecb791cf32315c13580d4571ea" - integrity sha512-YkiMHSL8CQ0vlWYpqGvlaZjViFk0Kar9jonPjSvaWoztkeHH6DENqUzBIsffzjVKhwchPI74SZRLRpIsEyNcZQ== - dependencies: - babel-runtime "^6.26.0" - core-js "^3.0.0" - debug "^4.1.1" - glob-to-regexp "^0.4.0" - is-subset "^0.1.1" - lodash.isequal "^4.5.0" - path-to-regexp "^2.2.1" - querystring "^0.2.0" - whatwg-url "^6.5.0" - figures@^1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e" @@ -3360,11 +3335,6 @@ glob-parent@^5.0.0, glob-parent@^5.1.0: dependencies: is-glob "^4.0.1" -glob-to-regexp@^0.4.0: - version "0.4.1" - resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz#c75297087c851b9a578bd217dd59a92f59fe546e" - integrity sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw== - glob@^7.0.0, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3: version "7.1.4" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.4.tgz#aa608a2f6c577ad357e1ae5a5c26d9a8d1969255" @@ -3930,11 +3900,6 @@ is-string@^1.0.5: resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.5.tgz#40493ed198ef3ff477b8c7f92f644ec82a5cd3a6" integrity sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ== -is-subset@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/is-subset/-/is-subset-0.1.1.tgz#8a59117d932de1de00f245fcdd39ce43f1e939a6" - integrity sha1-ilkRfZMt4d4A8kX83TnOQ/HpOaY= - is-symbol@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.2.tgz#a055f6ae57192caee329e7a860118b497a950f38" @@ -4657,7 +4622,7 @@ json-stable-stringify@^1.0.1: dependencies: jsonify "~0.0.0" -json-stringify-safe@~5.0.1: +json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= @@ -4942,16 +4907,16 @@ locate-path@^5.0.0: dependencies: p-locate "^4.1.0" -lodash.isequal@^4.5.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0" - integrity sha1-QVxEePK8wwEgwizhDtMib30+GOA= - lodash.memoize@4.x: version "4.1.2" resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe" integrity sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4= +lodash.set@^4.3.2: + version "4.3.2" + resolved "https://registry.yarnpkg.com/lodash.set/-/lodash.set-4.3.2.tgz#d8757b1da807dde24816b0d6a84bea1a76230b23" + integrity sha1-2HV7HagH3eJIFrDWqEvqGnYjCyM= + lodash.sortby@^4.7.0: version "4.7.0" resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" @@ -5273,6 +5238,16 @@ nise@^1.5.1: lolex "^4.1.0" path-to-regexp "^1.7.0" +nock@^13.0.7: + version "13.0.7" + resolved "https://registry.yarnpkg.com/nock/-/nock-13.0.7.tgz#9bc718c66bd0862dfa14601a9ba678a406127910" + integrity sha512-WBz73VYIjdbO6BwmXODRQLtn7B5tldA9pNpWJe5QTtTEscQlY5KXU4srnGzBOK2fWakkXj69gfTnXGzmrsaRWw== + dependencies: + debug "^4.1.0" + json-stringify-safe "^5.0.1" + lodash.set "^4.3.2" + propagate "^2.0.0" + node-addon-api@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-2.0.2.tgz#432cfa82962ce494b132e9d72a15b29f71ff5d32" @@ -5673,11 +5648,6 @@ path-to-regexp@^1.7.0: dependencies: isarray "0.0.1" -path-to-regexp@^2.2.1: - version "2.4.0" - resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-2.4.0.tgz#35ce7f333d5616f1c1e1bfe266c3aba2e5b2e704" - integrity sha512-G6zHoVqC6GGTQkZwF4lkuEyMbVOjoBKAEybQUypI1WTkqinCOrq2x6U2+phkJ1XsEMTy4LjtwPI7HW+NVrRR2w== - path-type@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/path-type/-/path-type-2.0.0.tgz#f012ccb8415b7096fc2daa1054c3d72389594c73" @@ -5852,6 +5822,11 @@ prompts@^2.0.1: kleur "^3.0.3" sisteransi "^1.0.3" +propagate@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/propagate/-/propagate-2.0.1.tgz#40cdedab18085c792334e64f0ac17256d38f9a45" + integrity sha512-vGrhOavPSTz4QVNuBNdcNXePNdNMaO1xj9yBeH1ScQPjk/rhg9sSlCXPhMkFuaNNW/syTvYqsnbIJxMBfRbbag== + prr@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476" @@ -5900,11 +5875,6 @@ qs@~6.5.2: resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== -querystring@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" - integrity sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA= - randombytes@^2.0.1, randombytes@^2.0.6, randombytes@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" @@ -7292,15 +7262,6 @@ whatwg-mimetype@^2.2.0, whatwg-mimetype@^2.3.0: resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf" integrity sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g== -whatwg-url@^6.5.0: - version "6.5.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-6.5.0.tgz#f2df02bff176fd65070df74ad5ccbb5a199965a8" - integrity sha512-rhRZRqx/TLJQWUpQ6bmrt2UV4f0HCQ463yQuONJqC6fO2VoEb1pTYddbe59SkYq87aoM5A3bdhMZiUiVws+fzQ== - dependencies: - lodash.sortby "^4.7.0" - tr46 "^1.0.1" - webidl-conversions "^4.0.2" - whatwg-url@^7.0.0: version "7.1.0" resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-7.1.0.tgz#c2c492f1eca612988efd3d2266be1b9fc6170d06"