msw 2.8.5 → 2.8.7
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/README.md +1 -1
- package/browser/package.json +3 -2
- package/cli/init.js +1 -1
- package/lib/browser/index.js +1 -1
- package/lib/browser/index.js.map +1 -1
- package/lib/browser/index.mjs +1 -1
- package/lib/browser/index.mjs.map +1 -1
- package/lib/core/handlers/HttpHandler.js +1 -1
- package/lib/core/handlers/HttpHandler.js.map +1 -1
- package/lib/core/handlers/HttpHandler.mjs +1 -1
- package/lib/core/handlers/HttpHandler.mjs.map +1 -1
- package/lib/core/utils/request/onUnhandledRequest.js +1 -1
- package/lib/core/utils/request/onUnhandledRequest.js.map +1 -1
- package/lib/core/utils/request/onUnhandledRequest.mjs +1 -1
- package/lib/core/utils/request/onUnhandledRequest.mjs.map +1 -1
- package/lib/iife/index.js +3 -3
- package/lib/iife/index.js.map +1 -1
- package/lib/mockServiceWorker.js +1 -1
- package/package.json +2 -2
- package/src/browser/setupWorker/start/createRequestListener.ts +1 -1
- package/src/core/handlers/HttpHandler.ts +1 -1
- package/src/core/utils/request/onUnhandledRequest.test.ts +3 -3
- package/src/core/utils/request/onUnhandledRequest.ts +1 -1
package/lib/mockServiceWorker.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* - Please do NOT serve this file on production.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
const PACKAGE_VERSION = '2.8.
|
|
11
|
+
const PACKAGE_VERSION = '2.8.7'
|
|
12
12
|
const INTEGRITY_CHECKSUM = '00729d72e3b82faf54ca8b9621dbb96f'
|
|
13
13
|
const IS_MOCKED_RESPONSE = Symbol('isMockedResponse')
|
|
14
14
|
const activeClientIds = new Set()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "msw",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.7",
|
|
4
4
|
"description": "Seamless REST/GraphQL API mocking library for browser and Node.js.",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "./lib/core/index.js",
|
|
@@ -279,7 +279,7 @@
|
|
|
279
279
|
"vitest-environment-miniflare": "^2.14.4",
|
|
280
280
|
"webpack": "^5.95.0",
|
|
281
281
|
"webpack-http-server": "^0.5.0",
|
|
282
|
-
"msw": "2.8.
|
|
282
|
+
"msw": "2.8.7"
|
|
283
283
|
},
|
|
284
284
|
"peerDependencies": {
|
|
285
285
|
"typescript": ">= 4.8.x"
|
|
@@ -111,7 +111,7 @@ export const createRequestListener = (
|
|
|
111
111
|
|
|
112
112
|
%s
|
|
113
113
|
|
|
114
|
-
This exception has been gracefully handled as a 500 response, however, it's strongly recommended to resolve this error, as it indicates a mistake in your code. If you wish to mock an error response, please see this guide: https://mswjs.io/docs/
|
|
114
|
+
This exception has been gracefully handled as a 500 response, however, it's strongly recommended to resolve this error, as it indicates a mistake in your code. If you wish to mock an error response, please see this guide: https://mswjs.io/docs/http/mocking-responses/error-responses`,
|
|
115
115
|
request.method,
|
|
116
116
|
request.url,
|
|
117
117
|
error.stack ?? error,
|
|
@@ -102,7 +102,7 @@ export class HttpHandler extends RequestHandler<
|
|
|
102
102
|
})
|
|
103
103
|
|
|
104
104
|
devUtils.warn(
|
|
105
|
-
`Found a redundant usage of query parameters in the request handler URL for "${method} ${path}". Please match against a path instead and access query parameters using "new URL(request.url).searchParams" instead. Learn more: https://mswjs.io/docs/
|
|
105
|
+
`Found a redundant usage of query parameters in the request handler URL for "${method} ${path}". Please match against a path instead and access query parameters using "new URL(request.url).searchParams" instead. Learn more: https://mswjs.io/docs/http/intercepting-requestsquery-parameters`,
|
|
106
106
|
)
|
|
107
107
|
}
|
|
108
108
|
|
|
@@ -11,7 +11,7 @@ const fixtures = {
|
|
|
11
11
|
• GET ${url}
|
|
12
12
|
|
|
13
13
|
If you still wish to intercept this unhandled request, please create a request handler for it.
|
|
14
|
-
Read more: https://mswjs.io/docs/
|
|
14
|
+
Read more: https://mswjs.io/docs/http/intercepting-requests`,
|
|
15
15
|
warningWithResponseBody: (url = `/api`) => `\
|
|
16
16
|
[MSW] Warning: intercepted a request without a matching request handler:
|
|
17
17
|
|
|
@@ -20,7 +20,7 @@ Read more: https://mswjs.io/docs/getting-started/mocks`,
|
|
|
20
20
|
• Request body: {\"variables\":{\"id\":\"abc-123\"},\"query\":\"query UserName($id: String!) { user(id: $id) { name } }\"}
|
|
21
21
|
|
|
22
22
|
If you still wish to intercept this unhandled request, please create a request handler for it.
|
|
23
|
-
Read more: https://mswjs.io/docs/
|
|
23
|
+
Read more: https://mswjs.io/docs/http/intercepting-requests`,
|
|
24
24
|
|
|
25
25
|
errorWithoutSuggestions: `\
|
|
26
26
|
[MSW] Error: intercepted a request without a matching request handler:
|
|
@@ -28,7 +28,7 @@ Read more: https://mswjs.io/docs/getting-started/mocks`,
|
|
|
28
28
|
• GET /api
|
|
29
29
|
|
|
30
30
|
If you still wish to intercept this unhandled request, please create a request handler for it.
|
|
31
|
-
Read more: https://mswjs.io/docs/
|
|
31
|
+
Read more: https://mswjs.io/docs/http/intercepting-requests`,
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
beforeEach(() => {
|
|
@@ -30,7 +30,7 @@ export async function onUnhandledRequest(
|
|
|
30
30
|
? null
|
|
31
31
|
: await request.clone().text()
|
|
32
32
|
const messageDetails = `\n\n \u2022 ${request.method} ${publicUrl}\n\n${requestBody ? ` \u2022 Request body: ${requestBody}\n\n` : ''}`
|
|
33
|
-
const unhandledRequestMessage = `intercepted a request without a matching request handler:${messageDetails}If you still wish to intercept this unhandled request, please create a request handler for it.\nRead more: https://mswjs.io/docs/
|
|
33
|
+
const unhandledRequestMessage = `intercepted a request without a matching request handler:${messageDetails}If you still wish to intercept this unhandled request, please create a request handler for it.\nRead more: https://mswjs.io/docs/http/intercepting-requests`
|
|
34
34
|
|
|
35
35
|
function applyStrategy(strategy: UnhandledRequestStrategy) {
|
|
36
36
|
switch (strategy) {
|