@zimic/interceptor 0.15.0-canary.3 → 0.16.0-canary.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/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/cli.mjs.map +1 -1
- package/dist/http.d.ts +1 -1
- package/dist/http.js +6 -3
- package/dist/http.js.map +1 -1
- package/dist/http.mjs +6 -3
- package/dist/http.mjs.map +1 -1
- package/package.json +5 -5
- package/src/http/interceptor/HttpInterceptorClient.ts +8 -3
- package/src/http/interceptor/types/public.ts +1 -1
package/dist/http.mjs
CHANGED
|
@@ -1509,7 +1509,7 @@ var HttpInterceptorClient = class {
|
|
|
1509
1509
|
worker;
|
|
1510
1510
|
store;
|
|
1511
1511
|
_baseURL;
|
|
1512
|
-
_saveRequests
|
|
1512
|
+
_saveRequests;
|
|
1513
1513
|
onUnhandledRequest;
|
|
1514
1514
|
isRunning = false;
|
|
1515
1515
|
Handler;
|
|
@@ -1526,7 +1526,7 @@ var HttpInterceptorClient = class {
|
|
|
1526
1526
|
this.worker = options.worker;
|
|
1527
1527
|
this.store = options.store;
|
|
1528
1528
|
this.baseURL = options.baseURL;
|
|
1529
|
-
this._saveRequests = options.saveRequests
|
|
1529
|
+
this._saveRequests = options.saveRequests;
|
|
1530
1530
|
this.onUnhandledRequest = options.onUnhandledRequest;
|
|
1531
1531
|
this.Handler = options.Handler;
|
|
1532
1532
|
}
|
|
@@ -1550,6 +1550,9 @@ var HttpInterceptorClient = class {
|
|
|
1550
1550
|
return this.baseURL.href;
|
|
1551
1551
|
}
|
|
1552
1552
|
get saveRequests() {
|
|
1553
|
+
if (this._saveRequests === void 0) {
|
|
1554
|
+
return isServerSide() ? process.env.NODE_ENV === "test" : false;
|
|
1555
|
+
}
|
|
1553
1556
|
return this._saveRequests;
|
|
1554
1557
|
}
|
|
1555
1558
|
set saveRequests(saveRequests) {
|
|
@@ -1652,7 +1655,7 @@ var HttpInterceptorClient = class {
|
|
|
1652
1655
|
}
|
|
1653
1656
|
const responseDeclaration = await matchedHandler.applyResponseDeclaration(parsedRequest);
|
|
1654
1657
|
const response = HttpInterceptorWorker_default.createResponseFromDeclaration(request, responseDeclaration);
|
|
1655
|
-
if (this.
|
|
1658
|
+
if (this.saveRequests) {
|
|
1656
1659
|
const responseClone = response.clone();
|
|
1657
1660
|
const parsedResponse = await HttpInterceptorWorker_default.parseRawResponse(responseClone);
|
|
1658
1661
|
matchedHandler.saveInterceptedRequest(parsedRequest, parsedResponse);
|