msw-fetch-mock 0.2.1 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,540 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2;// src/mock-call-history.ts
2
+ var MockCallHistoryLog = class {
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+ constructor(data) {
15
+ this.body = data.body;
16
+ this.method = data.method;
17
+ this.headers = data.headers;
18
+ this.fullUrl = data.fullUrl;
19
+ this.origin = data.origin;
20
+ this.path = data.path;
21
+ this.searchParams = data.searchParams;
22
+ this.protocol = data.protocol;
23
+ this.host = data.host;
24
+ this.port = data.port;
25
+ this.hash = data.hash;
26
+ }
27
+ json() {
28
+ if (this.body === null) return null;
29
+ return JSON.parse(this.body);
30
+ }
31
+ toMap() {
32
+ return /* @__PURE__ */ new Map([
33
+ ["body", this.body],
34
+ ["method", this.method],
35
+ ["headers", this.headers],
36
+ ["fullUrl", this.fullUrl],
37
+ ["origin", this.origin],
38
+ ["path", this.path],
39
+ ["searchParams", this.searchParams],
40
+ ["protocol", this.protocol],
41
+ ["host", this.host],
42
+ ["port", this.port],
43
+ ["hash", this.hash]
44
+ ]);
45
+ }
46
+ toString() {
47
+ return [
48
+ `method->${this.method}`,
49
+ `protocol->${this.protocol}`,
50
+ `host->${this.host}`,
51
+ `port->${this.port}`,
52
+ `origin->${this.origin}`,
53
+ `path->${this.path}`,
54
+ `hash->${this.hash}`,
55
+ `fullUrl->${this.fullUrl}`
56
+ ].join("|");
57
+ }
58
+ };
59
+ var MockCallHistory = (_class = class {constructor() { _class.prototype.__init.call(this); }
60
+ __init() {this.logs = []}
61
+ get length() {
62
+ return this.logs.length;
63
+ }
64
+ record(data) {
65
+ this.logs.push(data instanceof MockCallHistoryLog ? data : new MockCallHistoryLog(data));
66
+ }
67
+ called(criteria) {
68
+ if (criteria === void 0) return this.logs.length > 0;
69
+ return this.filterCalls(criteria).length > 0;
70
+ }
71
+ calls() {
72
+ return [...this.logs];
73
+ }
74
+ firstCall(criteria) {
75
+ if (criteria === void 0) return this.logs[0];
76
+ return this.filterCalls(criteria)[0];
77
+ }
78
+ lastCall(criteria) {
79
+ if (criteria === void 0) return this.logs[this.logs.length - 1];
80
+ const filtered = this.filterCalls(criteria);
81
+ return filtered[filtered.length - 1];
82
+ }
83
+ nthCall(n, criteria) {
84
+ if (criteria === void 0) return this.logs[n - 1];
85
+ return this.filterCalls(criteria)[n - 1];
86
+ }
87
+ clear() {
88
+ this.logs = [];
89
+ }
90
+ [Symbol.iterator]() {
91
+ return this.logs[Symbol.iterator]();
92
+ }
93
+ filterCalls(criteria, options) {
94
+ if (typeof criteria === "function") {
95
+ return this.logs.filter(criteria);
96
+ }
97
+ if (criteria instanceof RegExp) {
98
+ return this.logs.filter((log) => criteria.test(log.toString()));
99
+ }
100
+ const operator = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _ => _.operator]), () => ( "OR"));
101
+ const keys = Object.keys(criteria);
102
+ const predicates = keys.filter((key) => criteria[key] !== void 0).map((key) => (log) => log[key] === criteria[key]);
103
+ if (predicates.length === 0) return [...this.logs];
104
+ return this.logs.filter(
105
+ (log) => operator === "AND" ? predicates.every((p) => p(log)) : predicates.some((p) => p(log))
106
+ );
107
+ }
108
+ filterBy(field, filter) {
109
+ return this.logs.filter(
110
+ (log) => typeof filter === "string" ? log[field] === filter : filter.test(String(log[field]))
111
+ );
112
+ }
113
+ filterCallsByMethod(filter) {
114
+ return this.filterBy("method", filter);
115
+ }
116
+ filterCallsByPath(filter) {
117
+ return this.filterBy("path", filter);
118
+ }
119
+ filterCallsByOrigin(filter) {
120
+ return this.filterBy("origin", filter);
121
+ }
122
+ filterCallsByProtocol(filter) {
123
+ return this.filterBy("protocol", filter);
124
+ }
125
+ filterCallsByHost(filter) {
126
+ return this.filterBy("host", filter);
127
+ }
128
+ filterCallsByPort(filter) {
129
+ return this.filterBy("port", filter);
130
+ }
131
+ filterCallsByHash(filter) {
132
+ return this.filterBy("hash", filter);
133
+ }
134
+ filterCallsByFullUrl(filter) {
135
+ return this.filterBy("fullUrl", filter);
136
+ }
137
+ }, _class);
138
+
139
+ // src/matchers.ts
140
+ function isPending(p) {
141
+ if (p.persist) return p.timesInvoked === 0;
142
+ return p.timesInvoked < p.times;
143
+ }
144
+ function escapeRegExp(str) {
145
+ return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
146
+ }
147
+ function matchesValue(value, matcher) {
148
+ if (typeof matcher === "string") return value === matcher;
149
+ if (matcher instanceof RegExp) return matcher.test(value);
150
+ return matcher(value);
151
+ }
152
+ function matchPath(request, origin, pathMatcher) {
153
+ if (typeof pathMatcher === "string") return true;
154
+ const url = new URL(request.url);
155
+ const originPrefix = new URL(origin).pathname.replace(/\/$/, "");
156
+ const fullPath = url.pathname + url.search;
157
+ const relativePath = fullPath.startsWith(originPrefix) ? fullPath.slice(originPrefix.length) : fullPath;
158
+ return matchesValue(relativePath, pathMatcher);
159
+ }
160
+ function matchQuery(request, query) {
161
+ if (!query) return true;
162
+ const url = new URL(request.url);
163
+ for (const [key, value] of Object.entries(query)) {
164
+ if (url.searchParams.get(key) !== value) return false;
165
+ }
166
+ return true;
167
+ }
168
+ function matchHeaders(request, headers) {
169
+ if (!headers) return true;
170
+ for (const [key, matcher] of Object.entries(headers)) {
171
+ const value = request.headers.get(key);
172
+ if (value === null || !matchesValue(value, matcher)) return false;
173
+ }
174
+ return true;
175
+ }
176
+ function matchBody(bodyText, bodyMatcher) {
177
+ if (!bodyMatcher) return true;
178
+ return matchesValue(_nullishCoalesce(bodyText, () => ( "")), bodyMatcher);
179
+ }
180
+ function recordCall(callHistory, request, bodyText) {
181
+ const url = new URL(request.url);
182
+ const requestHeaders = {};
183
+ request.headers.forEach((value, key) => {
184
+ requestHeaders[key] = value;
185
+ });
186
+ const searchParams = {};
187
+ url.searchParams.forEach((value, key) => {
188
+ searchParams[key] = value;
189
+ });
190
+ callHistory.record({
191
+ body: bodyText,
192
+ method: request.method,
193
+ headers: requestHeaders,
194
+ fullUrl: url.origin + url.pathname + url.search,
195
+ origin: url.origin,
196
+ path: url.pathname,
197
+ searchParams,
198
+ protocol: url.protocol,
199
+ host: url.host,
200
+ port: url.port,
201
+ hash: url.hash
202
+ });
203
+ }
204
+
205
+ // src/type-guards.ts
206
+ function isSetupServerLike(input) {
207
+ return typeof input === "object" && input !== null && "listen" in input && typeof input.listen === "function" && "close" in input && typeof input.close === "function";
208
+ }
209
+ function isSetupWorkerLike(input) {
210
+ return typeof input === "object" && input !== null && "start" in input && typeof input.start === "function" && "stop" in input && typeof input.stop === "function";
211
+ }
212
+ function isMswAdapter(input) {
213
+ return typeof input === "object" && input !== null && "activate" in input && typeof input.activate === "function" && "deactivate" in input && typeof input.deactivate === "function";
214
+ }
215
+
216
+ // src/fetch-mock.ts
217
+ function createServerAdapter(server) {
218
+ return {
219
+ use: (...handlers) => server.use(...handlers),
220
+ resetHandlers: (...handlers) => server.resetHandlers(...handlers),
221
+ activate(options) {
222
+ server.listen({ onUnhandledRequest: options.onUnhandledRequest });
223
+ },
224
+ deactivate() {
225
+ server.close();
226
+ }
227
+ };
228
+ }
229
+ function createWorkerAdapter(worker) {
230
+ return {
231
+ use: (...handlers) => worker.use(...handlers),
232
+ resetHandlers: (...handlers) => worker.resetHandlers(...handlers),
233
+ async activate(options) {
234
+ await worker.start({ onUnhandledRequest: options.onUnhandledRequest });
235
+ },
236
+ deactivate() {
237
+ worker.stop();
238
+ }
239
+ };
240
+ }
241
+ function resolveAdapter(input) {
242
+ if (!input) {
243
+ if (!FetchMock._defaultAdapterFactory) {
244
+ throw new Error(
245
+ "FetchMock requires a server, worker, or adapter argument. Use createFetchMock() from msw-fetch-mock/node or msw-fetch-mock/browser, or pass a setupServer/setupWorker instance directly."
246
+ );
247
+ }
248
+ return FetchMock._defaultAdapterFactory();
249
+ }
250
+ if (isMswAdapter(input)) return input;
251
+ if (isSetupServerLike(input)) return createServerAdapter(input);
252
+ if (isSetupWorkerLike(input)) return createWorkerAdapter(input);
253
+ throw new Error("Invalid argument: expected a setupServer, setupWorker, or MswAdapter instance.");
254
+ }
255
+ var FetchMock = (_class2 = class _FetchMock {
256
+ /** @internal */
257
+
258
+ /** @internal */
259
+
260
+ get handlerFactory() {
261
+ if (!_FetchMock._handlerFactory) {
262
+ throw new Error(
263
+ "Handler factory not registered. Import from msw-fetch-mock/node or msw-fetch-mock/browser."
264
+ );
265
+ }
266
+ return _FetchMock._handlerFactory;
267
+ }
268
+ buildResponse(status, responseBody, replyOptions, defaultHeaders, addContentLength) {
269
+ const mergedHeaders = { ...defaultHeaders };
270
+ if (_optionalChain([replyOptions, 'optionalAccess', _2 => _2.headers])) {
271
+ Object.assign(mergedHeaders, replyOptions.headers);
272
+ }
273
+ if (addContentLength && responseBody !== null && responseBody !== void 0) {
274
+ mergedHeaders["Content-Length"] = String(JSON.stringify(responseBody).length);
275
+ }
276
+ const headers = Object.keys(mergedHeaders).length > 0 ? new Headers(mergedHeaders) : void 0;
277
+ return this.handlerFactory.buildResponse(status, responseBody, headers);
278
+ }
279
+ __init2() {this._calls = new MockCallHistory()}
280
+
281
+ __init3() {this.interceptors = []}
282
+ __init4() {this.netConnectAllowed = false}
283
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
284
+ __init5() {this.mswHandlers = /* @__PURE__ */ new Map()}
285
+ __init6() {this._defaultReplyHeaders = {}}
286
+ __init7() {this._callHistoryEnabled = true}
287
+ get calls() {
288
+ return this._calls;
289
+ }
290
+ constructor(input) {;_class2.prototype.__init2.call(this);_class2.prototype.__init3.call(this);_class2.prototype.__init4.call(this);_class2.prototype.__init5.call(this);_class2.prototype.__init6.call(this);_class2.prototype.__init7.call(this);
291
+ this.adapter = resolveAdapter(input);
292
+ }
293
+ async activate(options) {
294
+ const mode = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _3 => _3.onUnhandledRequest]), () => ( "error"));
295
+ await this.adapter.activate({
296
+ onUnhandledRequest: (request, print) => {
297
+ if (this.isNetConnectAllowed(request)) return;
298
+ if (typeof mode === "function") {
299
+ mode(request, print);
300
+ } else if (mode === "error") {
301
+ print.error();
302
+ } else if (mode === "warn") {
303
+ print.warning();
304
+ }
305
+ }
306
+ });
307
+ }
308
+ disableNetConnect() {
309
+ this.netConnectAllowed = false;
310
+ }
311
+ enableNetConnect(matcher) {
312
+ this.netConnectAllowed = _nullishCoalesce(matcher, () => ( true));
313
+ }
314
+ isNetConnectAllowed(request) {
315
+ if (this.netConnectAllowed === true) return true;
316
+ if (this.netConnectAllowed === false) return false;
317
+ const host = new URL(request.url).host;
318
+ if (typeof this.netConnectAllowed === "string") return host === this.netConnectAllowed;
319
+ if (this.netConnectAllowed instanceof RegExp) return this.netConnectAllowed.test(host);
320
+ return this.netConnectAllowed(host);
321
+ }
322
+ /**
323
+ * Remove consumed MSW handlers so future requests to those URLs
324
+ * go through MSW's onUnhandledRequest instead of silently passing through.
325
+ */
326
+ syncMswHandlers() {
327
+ const activeHandlers = [...this.mswHandlers.entries()].filter(([p]) => !p.consumed || p.persist).map(([, handler]) => handler);
328
+ this.adapter.resetHandlers(...activeHandlers);
329
+ }
330
+ getCallHistory() {
331
+ return this._calls;
332
+ }
333
+ clearCallHistory() {
334
+ this._calls.clear();
335
+ }
336
+ clearAllCallHistory() {
337
+ this.clearCallHistory();
338
+ }
339
+ defaultReplyHeaders(headers) {
340
+ this._defaultReplyHeaders = headers;
341
+ }
342
+ enableCallHistory() {
343
+ this._callHistoryEnabled = true;
344
+ }
345
+ disableCallHistory() {
346
+ this._callHistoryEnabled = false;
347
+ }
348
+ deactivate() {
349
+ this.interceptors = [];
350
+ this.mswHandlers.clear();
351
+ this._calls.clear();
352
+ this.adapter.deactivate();
353
+ }
354
+ reset() {
355
+ this.interceptors = [];
356
+ this.mswHandlers.clear();
357
+ this._calls.clear();
358
+ this._defaultReplyHeaders = {};
359
+ this.adapter.resetHandlers();
360
+ }
361
+ assertNoPendingInterceptors() {
362
+ const unconsumed = this.interceptors.filter(isPending);
363
+ if (unconsumed.length > 0) {
364
+ const descriptions = unconsumed.map((p) => ` ${p.method} ${p.origin}${p.path}`);
365
+ throw new Error(`Pending interceptor(s) not consumed:
366
+ ${descriptions.join("\n")}`);
367
+ }
368
+ }
369
+ pendingInterceptors() {
370
+ return this.interceptors.filter(isPending).map((p) => ({ ...p }));
371
+ }
372
+ resolveUrlPattern(origin, path) {
373
+ if (typeof origin === "string") {
374
+ return typeof path === "string" ? `${origin}${path}` : new RegExp(`^${escapeRegExp(origin)}`);
375
+ }
376
+ return /.*/;
377
+ }
378
+ matchOrigin(request, origin) {
379
+ if (typeof origin === "string") return true;
380
+ const url = new URL(request.url);
381
+ if (origin instanceof RegExp) return origin.test(url.origin);
382
+ return origin(url.origin);
383
+ }
384
+ matchPathForOrigin(request, origin, originStr, path) {
385
+ if (typeof origin !== "string") {
386
+ if (typeof path === "string") {
387
+ const url2 = new URL(request.url);
388
+ return url2.pathname === path || url2.pathname.endsWith(path);
389
+ }
390
+ const url = new URL(request.url);
391
+ const fullPath = url.pathname + url.search;
392
+ return matchesValue(fullPath, path);
393
+ }
394
+ return matchPath(request, originStr, path);
395
+ }
396
+ async matchAndConsume(request, pending, origin, originStr, options) {
397
+ if (!pending.persist && pending.timesInvoked >= pending.times) return;
398
+ if (!this.matchOrigin(request, origin)) return;
399
+ if (!this.matchPathForOrigin(request, origin, originStr, options.path)) return;
400
+ if (!matchQuery(request, options.query)) return;
401
+ if (!matchHeaders(request, options.headers)) return;
402
+ const bodyText = await request.text() || null;
403
+ if (!matchBody(bodyText, options.body)) return;
404
+ pending.timesInvoked++;
405
+ if (!pending.persist && pending.timesInvoked >= pending.times) {
406
+ pending.consumed = true;
407
+ this.syncMswHandlers();
408
+ }
409
+ if (this._callHistoryEnabled) {
410
+ recordCall(this._calls, request, bodyText);
411
+ }
412
+ return bodyText;
413
+ }
414
+ registerHandler(pending, method, urlPattern, handlerFn) {
415
+ const handler = this.handlerFactory.createHandler(method, urlPattern, handlerFn);
416
+ this.mswHandlers.set(pending, handler);
417
+ this.adapter.use(handler);
418
+ }
419
+ buildChain(pending, delayRef, contentLengthRef) {
420
+ return {
421
+ times(n) {
422
+ pending.times = n;
423
+ pending.consumed = false;
424
+ },
425
+ persist() {
426
+ pending.persist = true;
427
+ pending.consumed = false;
428
+ },
429
+ delay(ms) {
430
+ delayRef.ms = ms;
431
+ },
432
+ replyContentLength() {
433
+ contentLengthRef.enabled = true;
434
+ }
435
+ };
436
+ }
437
+ get(origin) {
438
+ const originStr = typeof origin === "string" ? origin : origin instanceof RegExp ? origin.toString() : "<function>";
439
+ return {
440
+ intercept: (options) => {
441
+ const method = _nullishCoalesce(options.method, () => ( "GET"));
442
+ const pathStr = typeof options.path === "string" ? options.path : typeof options.path === "function" ? "<function>" : options.path.toString();
443
+ const pending = {
444
+ origin: originStr,
445
+ path: pathStr,
446
+ method,
447
+ consumed: false,
448
+ times: 1,
449
+ timesInvoked: 0,
450
+ persist: false
451
+ };
452
+ this.interceptors.push(pending);
453
+ const urlPattern = this.resolveUrlPattern(origin, options.path);
454
+ return {
455
+ reply: (statusOrCallback, bodyOrCallback, replyOptions) => {
456
+ const delayRef = { ms: 0 };
457
+ const contentLengthRef = { enabled: false };
458
+ if (typeof statusOrCallback === "function") {
459
+ const callback = statusOrCallback;
460
+ this.registerHandler(pending, method, urlPattern, async (request) => {
461
+ const bodyText = await this.matchAndConsume(
462
+ request,
463
+ pending,
464
+ origin,
465
+ originStr,
466
+ options
467
+ );
468
+ if (bodyText === void 0) return;
469
+ if (delayRef.ms > 0) {
470
+ await new Promise((resolve) => setTimeout(resolve, delayRef.ms));
471
+ }
472
+ const result = await callback({ body: bodyText || null });
473
+ return this.buildResponse(
474
+ result.statusCode,
475
+ result.data,
476
+ result.responseOptions,
477
+ this._defaultReplyHeaders,
478
+ contentLengthRef.enabled
479
+ );
480
+ });
481
+ } else {
482
+ const status = statusOrCallback;
483
+ this.registerHandler(pending, method, urlPattern, async (request) => {
484
+ const bodyText = await this.matchAndConsume(
485
+ request,
486
+ pending,
487
+ origin,
488
+ originStr,
489
+ options
490
+ );
491
+ if (bodyText === void 0) return;
492
+ if (delayRef.ms > 0) {
493
+ await new Promise((resolve) => setTimeout(resolve, delayRef.ms));
494
+ }
495
+ let responseBody;
496
+ if (typeof bodyOrCallback === "function") {
497
+ responseBody = await bodyOrCallback({
498
+ body: bodyText || null
499
+ });
500
+ } else {
501
+ responseBody = bodyOrCallback;
502
+ }
503
+ return this.buildResponse(
504
+ status,
505
+ responseBody,
506
+ replyOptions,
507
+ this._defaultReplyHeaders,
508
+ contentLengthRef.enabled
509
+ );
510
+ });
511
+ }
512
+ return this.buildChain(pending, delayRef, contentLengthRef);
513
+ },
514
+ replyWithError: () => {
515
+ const delayRef = { ms: 0 };
516
+ const contentLengthRef = { enabled: false };
517
+ this.registerHandler(pending, method, urlPattern, async (request) => {
518
+ const bodyText = await this.matchAndConsume(
519
+ request,
520
+ pending,
521
+ origin,
522
+ originStr,
523
+ options
524
+ );
525
+ if (bodyText === void 0) return;
526
+ return this.handlerFactory.buildErrorResponse();
527
+ });
528
+ return this.buildChain(pending, delayRef, contentLengthRef);
529
+ }
530
+ };
531
+ }
532
+ };
533
+ }
534
+ }, _class2);
535
+
536
+
537
+
538
+
539
+
540
+ exports.MockCallHistoryLog = MockCallHistoryLog; exports.MockCallHistory = MockCallHistory; exports.FetchMock = FetchMock;
@@ -0,0 +1,58 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
+
3
+ var _chunkHYRDB2FHcjs = require('./chunk-HYRDB2FH.cjs');
4
+
5
+
6
+ var _chunk43CWIVXOcjs = require('./chunk-43CWIVXO.cjs');
7
+
8
+ // src/node-adapter.ts
9
+ var _node = require('msw/node');
10
+ var NodeMswAdapter = class {
11
+
12
+
13
+ constructor(externalServer) {
14
+ this.server = _nullishCoalesce(externalServer, () => ( null));
15
+ this.ownsServer = !externalServer;
16
+ }
17
+ use(...handlers) {
18
+ this.server.use(...handlers);
19
+ }
20
+ resetHandlers(...handlers) {
21
+ this.server.resetHandlers(...handlers);
22
+ }
23
+ activate(options) {
24
+ if (!this.ownsServer) return;
25
+ const isPatched = Object.getOwnPropertySymbols(globalThis.fetch).some(
26
+ (s) => s.description === "isPatchedModule"
27
+ );
28
+ if (isPatched) {
29
+ throw new Error(
30
+ "Another MSW server is already active. Pass your existing server to new FetchMock(server) instead."
31
+ );
32
+ }
33
+ this.server = _node.setupServer.call(void 0, );
34
+ this.server.listen({
35
+ onUnhandledRequest: options.onUnhandledRequest
36
+ });
37
+ }
38
+ deactivate() {
39
+ if (this.ownsServer) {
40
+ _optionalChain([this, 'access', _ => _.server, 'optionalAccess', _2 => _2.close, 'call', _3 => _3()]);
41
+ this.server = null;
42
+ }
43
+ }
44
+ };
45
+
46
+ // src/node.ts
47
+ _chunk43CWIVXOcjs.FetchMock._defaultAdapterFactory = () => new NodeMswAdapter();
48
+ _chunk43CWIVXOcjs.FetchMock._handlerFactory = _chunkHYRDB2FHcjs.v2HandlerFactory;
49
+ function createFetchMock(server) {
50
+ return new (0, _chunk43CWIVXOcjs.FetchMock)(new NodeMswAdapter(server));
51
+ }
52
+ var fetchMock = createFetchMock();
53
+
54
+
55
+
56
+
57
+
58
+ exports.NodeMswAdapter = NodeMswAdapter; exports.createFetchMock = createFetchMock; exports.fetchMock = fetchMock;