@4c/fetch-mock
Version:
Mock http requests made using fetch (or isomorphic-fetch)
16 lines (12 loc) • 456 B
JavaScript
const FetchMock = require('./lib/index');
const statusTextMap = require('./lib/status-text');
const theGlobal = typeof window !== 'undefined' ? window : self;
FetchMock.global = theGlobal;
FetchMock.statusTextMap = statusTextMap;
FetchMock.config = Object.assign(FetchMock.config, {
Promise: theGlobal.Promise,
Request: theGlobal.Request,
Response: theGlobal.Response,
Headers: theGlobal.Headers
});
module.exports = FetchMock.createInstance(true);