1 | // Copyright 2017-2018 @polkadot/api-provider authors & contributors
|
2 | // This software may be modified and distributed under the terms
|
3 | // of the ISC license. See the LICENSE file for details.
|
4 |
|
5 | describe('http/polyfill', () => {
|
6 | let origFetch;
|
7 |
|
8 | beforeEach(() => {
|
9 | origFetch = global.fetch;
|
10 | global.fetch = null;
|
11 | });
|
12 |
|
13 | afterEach(() => {
|
14 | global.fetch = origFetch;
|
15 | });
|
16 |
|
17 | it('polyfills with no exceptions (without fetch)', () => {
|
18 | expect(require('./polyfill')).toBeDefined();
|
19 | });
|
20 |
|
21 | it('polyfills with no exceptions (with fetch)', () => {
|
22 | global.fetch = () => true;
|
23 |
|
24 | expect(require('./polyfill')).toBeDefined();
|
25 | });
|
26 | });
|