@hyper-fetch/core 5.1.1 → 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.
@@ -1429,7 +1429,7 @@ var getAdapterBindings = (req, requestId, systemErrorStatus, systemErrorExtra) =
1429
1429
  if (processingError) {
1430
1430
  return onError(processingError, systemErrorStatus, systemErrorExtra, () => null);
1431
1431
  }
1432
- if (req.mock && req.isMockEnabled) {
1432
+ if (req.mock && req.isMockEnabled && req.client.isMockEnabled) {
1433
1433
  return mocker(request, {
1434
1434
  onError,
1435
1435
  onResponseEnd,
@@ -2219,6 +2219,7 @@ var Client = class {
2219
2219
  this.loggerManager = new LoggerManager(this);
2220
2220
  this.defaultMethod = "GET" /* get */;
2221
2221
  this.defaultExtra = xhrExtra;
2222
+ this.isMockEnabled = true;
2222
2223
  this.effects = [];
2223
2224
  this.abortKeyMapper = getSimpleKey;
2224
2225
  this.cacheKeyMapper = getRequestKey;
@@ -2265,6 +2266,10 @@ var Client = class {
2265
2266
  this.payloadMapper = payloadMapper;
2266
2267
  return this;
2267
2268
  };
2269
+ this.setEnableGlobalMocking = (isMockEnabled) => {
2270
+ this.isMockEnabled = isMockEnabled;
2271
+ return this;
2272
+ };
2268
2273
  this.setEndpointMapper = (endpointMapper) => {
2269
2274
  this.endpointMapper = endpointMapper;
2270
2275
  return this;