Skip to content

Commit 18041fb

Browse files
committed
fix a test that should've always failed reallyI guess node 15 is stricter about some things
1 parent f6f4d08 commit 18041fb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

test/specs/config/fallbackToNetwork.test.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ describe('fallbackToNetwork', () => {
1313
});
1414

1515
it('not error when configured globally', async () => {
16+
theGlobal.fetch = async () => ({ status: 202 });
1617
fm.config.fallbackToNetwork = true;
1718
fm.mock('http://mocked.com', 201);
1819
expect(() => fm.fetchHandler('http://unmocked.com')).not.to.throw();
20+
delete theGlobal.fetch
1921
});
2022

2123
it('actually falls back to network when configured globally', async () => {
@@ -26,6 +28,7 @@ describe('fallbackToNetwork', () => {
2628
expect(res.status).to.equal(202);
2729
fetchMock.restore();
2830
fetchMock.config.fallbackToNetwork = false;
31+
delete theGlobal.fetch
2932
});
3033

3134
it('actually falls back to network when configured in a sandbox properly', async () => {

0 commit comments

Comments
 (0)