UNPKG

821 BJavaScriptView Raw
1'use strict';
2
3var _assign = require('babel-runtime/core-js/object/assign');
4
5var _assign2 = _interopRequireDefault(_assign);
6
7function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
8
9var FetchMock = require('./lib/index');
10var statusTextMap = require('./lib/status-text');
11var theGlobal = typeof window !== 'undefined' ? window : self;
12
13var _require = require('./lib/request-utils'),
14 setUrlImplementation = _require.setUrlImplementation;
15
16setUrlImplementation(theGlobal.URL);
17
18FetchMock.global = theGlobal;
19FetchMock.statusTextMap = statusTextMap;
20
21FetchMock.config = (0, _assign2.default)(FetchMock.config, {
22 Promise: theGlobal.Promise,
23 Request: theGlobal.Request,
24 Response: theGlobal.Response,
25 Headers: theGlobal.Headers
26});
27
28module.exports = FetchMock.createInstance();
\No newline at end of file