@zimic/interceptor 1.0.1 → 1.0.2-canary.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.
- 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.js +3 -3
- package/dist/http.js.map +1 -1
- package/dist/http.mjs +3 -3
- package/dist/http.mjs.map +1 -1
- package/package.json +6 -6
- package/src/http/requestHandler/HttpRequestHandlerClient.ts +4 -4
package/package.json
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"api",
|
|
15
15
|
"static"
|
|
16
16
|
],
|
|
17
|
-
"version": "1.0.1",
|
|
17
|
+
"version": "1.0.2-canary.1",
|
|
18
18
|
"repository": {
|
|
19
19
|
"type": "git",
|
|
20
20
|
"url": "https://github.com/zimicjs/zimic.git",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"@whatwg-node/server": "0.10.12",
|
|
83
83
|
"execa": "9.6.0",
|
|
84
84
|
"isomorphic-ws": "5.0.0",
|
|
85
|
-
"msw": "2.10.
|
|
85
|
+
"msw": "2.10.5",
|
|
86
86
|
"picocolors": "^1.1.1",
|
|
87
87
|
"ws": "8.18.3",
|
|
88
88
|
"yargs": "18.0.0",
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"bufferutil": "4.0.9"
|
|
93
93
|
},
|
|
94
94
|
"devDependencies": {
|
|
95
|
-
"@types/node": "^24.
|
|
95
|
+
"@types/node": "^24.3.0",
|
|
96
96
|
"@types/ws": "^8.18.1",
|
|
97
97
|
"@types/yargs": "^17.0.33",
|
|
98
98
|
"@vitest/browser": "^3.2.4",
|
|
@@ -105,12 +105,12 @@
|
|
|
105
105
|
"vitest": "^3.2.4",
|
|
106
106
|
"@zimic/eslint-config-node": "0.0.0",
|
|
107
107
|
"@zimic/lint-staged-config": "0.0.0",
|
|
108
|
-
"@zimic/
|
|
109
|
-
"@zimic/
|
|
108
|
+
"@zimic/utils": "0.0.0",
|
|
109
|
+
"@zimic/tsconfig": "0.0.0"
|
|
110
110
|
},
|
|
111
111
|
"peerDependencies": {
|
|
112
112
|
"typescript": ">=5.0.0",
|
|
113
|
-
"@zimic/http": "^1.0.0 || 1.0.
|
|
113
|
+
"@zimic/http": "^1.0.0 || 1.0.2-canary.0"
|
|
114
114
|
},
|
|
115
115
|
"peerDependenciesMeta": {
|
|
116
116
|
"typescript": {
|
|
@@ -161,10 +161,6 @@ class HttpRequestHandlerClient<
|
|
|
161
161
|
async matchesRequest(request: HttpInterceptorRequest<Path, Default<Schema[Path][Method]>>): Promise<boolean> {
|
|
162
162
|
const hasDeclaredResponse = this.createResponseDeclaration !== undefined;
|
|
163
163
|
|
|
164
|
-
if (!hasDeclaredResponse) {
|
|
165
|
-
return false;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
164
|
const restrictionsMatch = await this.matchesRequestRestrictions(request);
|
|
169
165
|
|
|
170
166
|
if (restrictionsMatch.value) {
|
|
@@ -180,6 +176,10 @@ class HttpRequestHandlerClient<
|
|
|
180
176
|
}
|
|
181
177
|
}
|
|
182
178
|
|
|
179
|
+
if (!hasDeclaredResponse) {
|
|
180
|
+
return false;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
183
|
const isWithinLimits = this.numberOfMatchedRequests <= this.limits.numberOfRequests.max;
|
|
184
184
|
return restrictionsMatch.value && isWithinLimits;
|
|
185
185
|
}
|