From 0f0cac5456105a54fc6cc25467e820f134fa1223 Mon Sep 17 00:00:00 2001 From: Rhys Evans Date: Sat, 21 Nov 2020 22:06:07 +0000 Subject: [PATCH] fix a test that should've always failed reallyI guess node 15 is stricter about some things --- test/specs/config/fallbackToNetwork.test.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/specs/config/fallbackToNetwork.test.js b/test/specs/config/fallbackToNetwork.test.js index 40499c16..22bb4562 100644 --- a/test/specs/config/fallbackToNetwork.test.js +++ b/test/specs/config/fallbackToNetwork.test.js @@ -13,9 +13,11 @@ describe('fallbackToNetwork', () => { }); it('not error when configured globally', async () => { + theGlobal.fetch = async () => ({ status: 202 }); fm.config.fallbackToNetwork = true; fm.mock('http://mocked.com', 201); expect(() => fm.fetchHandler('http://unmocked.com')).not.to.throw(); + delete theGlobal.fetch }); it('actually falls back to network when configured globally', async () => { @@ -26,6 +28,7 @@ describe('fallbackToNetwork', () => { expect(res.status).to.equal(202); fetchMock.restore(); fetchMock.config.fallbackToNetwork = false; + delete theGlobal.fetch }); it('actually falls back to network when configured in a sandbox properly', async () => {