@hyper-fetch/core 5.1.2 → 5.2.0

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.
package/dist/index.cjs.js CHANGED
@@ -1508,7 +1508,7 @@ var getAdapterBindings = (req, requestId, systemErrorStatus, systemErrorExtra) =
1508
1508
  if (processingError) {
1509
1509
  return onError(processingError, systemErrorStatus, systemErrorExtra, () => null);
1510
1510
  }
1511
- if (req.mock && req.isMockEnabled) {
1511
+ if (req.mock && req.isMockEnabled && req.client.isMockEnabled) {
1512
1512
  return mocker(request, {
1513
1513
  onError,
1514
1514
  onResponseEnd,
@@ -2298,6 +2298,7 @@ var Client = class {
2298
2298
  this.loggerManager = new LoggerManager(this);
2299
2299
  this.defaultMethod = "GET" /* get */;
2300
2300
  this.defaultExtra = xhrExtra;
2301
+ this.isMockEnabled = true;
2301
2302
  this.effects = [];
2302
2303
  this.abortKeyMapper = getSimpleKey;
2303
2304
  this.cacheKeyMapper = getRequestKey;
@@ -2344,6 +2345,10 @@ var Client = class {
2344
2345
  this.payloadMapper = payloadMapper;
2345
2346
  return this;
2346
2347
  };
2348
+ this.setEnableGlobalMocking = (isMockEnabled) => {
2349
+ this.isMockEnabled = isMockEnabled;
2350
+ return this;
2351
+ };
2347
2352
  this.setEndpointMapper = (endpointMapper) => {
2348
2353
  this.endpointMapper = endpointMapper;
2349
2354
  return this;