From b481497246316c90ab95cf14a393d1f8ae7eeafc Mon Sep 17 00:00:00 2001 From: Dan Miller Date: Tue, 7 May 2019 15:22:02 -0230 Subject: Fix fetch and ethquery mocks in integration tests --- test/integration/lib/send-new-ui.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'test/integration/lib/send-new-ui.js') diff --git a/test/integration/lib/send-new-ui.js b/test/integration/lib/send-new-ui.js index 6a58611d1..85487a59f 100644 --- a/test/integration/lib/send-new-ui.js +++ b/test/integration/lib/send-new-ui.js @@ -25,6 +25,7 @@ global.ethereumProvider = {} async function runSendFlowTest (assert, done) { const tempFetch = global.fetch + const realFetch = window.fetch.bind(window) global.fetch = (...args) => { if (args[0] === 'https://ethgasstation.info/json/ethgasAPI.json') { return Promise.resolve({ json: () => Promise.resolve(JSON.parse(fetchMockResponses.ethGasBasic)) }) @@ -35,7 +36,7 @@ async function runSendFlowTest (assert, done) { } else if (args[0].match(/chromeextensionmm/)) { return Promise.resolve({ json: () => Promise.resolve(JSON.parse(fetchMockResponses.metametrics)) }) } - return window.fetch(...args) + return realFetch.fetch(...args) } console.log('*** start runSendFlowTest') -- cgit v1.2.3