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