@polkadot/api-provider
Version:
Transport providers for the API
27 lines (20 loc) • 650 B
JavaScript
// Copyright 2017-2018 @polkadot/api-provider authors & contributors
// This software may be modified and distributed under the terms
// of the ISC license. See the LICENSE file for details.
describe('http/polyfill', () => {
let origFetch;
beforeEach(() => {
origFetch = global.fetch;
global.fetch = null;
});
afterEach(() => {
global.fetch = origFetch;
});
it('polyfills with no exceptions (without fetch)', () => {
expect(require('./polyfill')).toBeDefined();
});
it('polyfills with no exceptions (with fetch)', () => {
global.fetch = () => true;
expect(require('./polyfill')).toBeDefined();
});
});