UNPKG

554 BJavaScriptView Raw
1const FetchMock = require('./lib/index');
2const statusTextMap = require('./lib/status-text');
3const theGlobal = typeof window !== 'undefined' ? window : self;
4const { setUrlImplementation } = require('./lib/request-utils');
5setUrlImplementation(theGlobal.URL);
6
7FetchMock.global = theGlobal;
8FetchMock.statusTextMap = statusTextMap;
9
10FetchMock.config = Object.assign(FetchMock.config, {
11 Promise: theGlobal.Promise,
12 Request: theGlobal.Request,
13 Response: theGlobal.Response,
14 Headers: theGlobal.Headers
15});
16
17module.exports = FetchMock.createInstance();