@depup/msw 2.12.13-depup.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/LICENSE.md +21 -0
- package/README.md +40 -0
- package/browser/package.json +31 -0
- package/changes.json +46 -0
- package/cli/index.js +35 -0
- package/cli/init.js +226 -0
- package/cli/invariant.js +9 -0
- package/cli/package.json +3 -0
- package/config/constants.js +13 -0
- package/config/package.json +3 -0
- package/config/scripts/postinstall.js +36 -0
- package/lib/browser/index.d.mts +102 -0
- package/lib/browser/index.d.ts +102 -0
- package/lib/browser/index.js +2911 -0
- package/lib/browser/index.js.map +1 -0
- package/lib/browser/index.mjs +2888 -0
- package/lib/browser/index.mjs.map +1 -0
- package/lib/core/HttpResponse-Be4eT3x6.d.mts +338 -0
- package/lib/core/HttpResponse-Dj6ibgFJ.d.ts +338 -0
- package/lib/core/HttpResponse.d.mts +6 -0
- package/lib/core/HttpResponse.d.ts +6 -0
- package/lib/core/HttpResponse.js +176 -0
- package/lib/core/HttpResponse.js.map +1 -0
- package/lib/core/HttpResponse.mjs +159 -0
- package/lib/core/HttpResponse.mjs.map +1 -0
- package/lib/core/SetupApi.d.mts +44 -0
- package/lib/core/SetupApi.d.ts +44 -0
- package/lib/core/SetupApi.js +112 -0
- package/lib/core/SetupApi.js.map +1 -0
- package/lib/core/SetupApi.mjs +92 -0
- package/lib/core/SetupApi.mjs.map +1 -0
- package/lib/core/bypass.d.mts +16 -0
- package/lib/core/bypass.d.ts +16 -0
- package/lib/core/bypass.js +42 -0
- package/lib/core/bypass.js.map +1 -0
- package/lib/core/bypass.mjs +22 -0
- package/lib/core/bypass.mjs.map +1 -0
- package/lib/core/delay.d.mts +18 -0
- package/lib/core/delay.d.ts +18 -0
- package/lib/core/delay.js +77 -0
- package/lib/core/delay.js.map +1 -0
- package/lib/core/delay.mjs +57 -0
- package/lib/core/delay.mjs.map +1 -0
- package/lib/core/getResponse.d.mts +18 -0
- package/lib/core/getResponse.d.ts +18 -0
- package/lib/core/getResponse.js +35 -0
- package/lib/core/getResponse.js.map +1 -0
- package/lib/core/getResponse.mjs +17 -0
- package/lib/core/getResponse.mjs.map +1 -0
- package/lib/core/graphql.d.mts +76 -0
- package/lib/core/graphql.d.ts +76 -0
- package/lib/core/graphql.js +90 -0
- package/lib/core/graphql.js.map +1 -0
- package/lib/core/graphql.mjs +72 -0
- package/lib/core/graphql.mjs.map +1 -0
- package/lib/core/handlers/GraphQLHandler.d.mts +6 -0
- package/lib/core/handlers/GraphQLHandler.d.ts +6 -0
- package/lib/core/handlers/GraphQLHandler.js +231 -0
- package/lib/core/handlers/GraphQLHandler.js.map +1 -0
- package/lib/core/handlers/GraphQLHandler.mjs +218 -0
- package/lib/core/handlers/GraphQLHandler.mjs.map +1 -0
- package/lib/core/handlers/HttpHandler.d.mts +75 -0
- package/lib/core/handlers/HttpHandler.d.ts +75 -0
- package/lib/core/handlers/HttpHandler.js +128 -0
- package/lib/core/handlers/HttpHandler.js.map +1 -0
- package/lib/core/handlers/HttpHandler.mjs +112 -0
- package/lib/core/handlers/HttpHandler.mjs.map +1 -0
- package/lib/core/handlers/RequestHandler.d.mts +6 -0
- package/lib/core/handlers/RequestHandler.d.ts +6 -0
- package/lib/core/handlers/RequestHandler.js +173 -0
- package/lib/core/handlers/RequestHandler.js.map +1 -0
- package/lib/core/handlers/RequestHandler.mjs +155 -0
- package/lib/core/handlers/RequestHandler.mjs.map +1 -0
- package/lib/core/handlers/WebSocketHandler.d.mts +42 -0
- package/lib/core/handlers/WebSocketHandler.d.ts +42 -0
- package/lib/core/handlers/WebSocketHandler.js +147 -0
- package/lib/core/handlers/WebSocketHandler.js.map +1 -0
- package/lib/core/handlers/WebSocketHandler.mjs +129 -0
- package/lib/core/handlers/WebSocketHandler.mjs.map +1 -0
- package/lib/core/handlers/common.d.mts +3 -0
- package/lib/core/handlers/common.d.ts +3 -0
- package/lib/core/handlers/common.js +17 -0
- package/lib/core/handlers/common.js.map +1 -0
- package/lib/core/handlers/common.mjs +1 -0
- package/lib/core/handlers/common.mjs.map +1 -0
- package/lib/core/http.d.mts +31 -0
- package/lib/core/http.d.ts +31 -0
- package/lib/core/http.js +40 -0
- package/lib/core/http.js.map +1 -0
- package/lib/core/http.mjs +23 -0
- package/lib/core/http.mjs.map +1 -0
- package/lib/core/index.d.mts +32 -0
- package/lib/core/index.d.ts +32 -0
- package/lib/core/index.js +64 -0
- package/lib/core/index.js.map +1 -0
- package/lib/core/index.mjs +52 -0
- package/lib/core/index.mjs.map +1 -0
- package/lib/core/isCommonAssetRequest.d.mts +20 -0
- package/lib/core/isCommonAssetRequest.d.ts +20 -0
- package/lib/core/isCommonAssetRequest.js +42 -0
- package/lib/core/isCommonAssetRequest.js.map +1 -0
- package/lib/core/isCommonAssetRequest.mjs +22 -0
- package/lib/core/isCommonAssetRequest.mjs.map +1 -0
- package/lib/core/passthrough.d.mts +24 -0
- package/lib/core/passthrough.d.ts +24 -0
- package/lib/core/passthrough.js +33 -0
- package/lib/core/passthrough.js.map +1 -0
- package/lib/core/passthrough.mjs +13 -0
- package/lib/core/passthrough.mjs.map +1 -0
- package/lib/core/sharedOptions.d.mts +64 -0
- package/lib/core/sharedOptions.d.ts +64 -0
- package/lib/core/sharedOptions.js +17 -0
- package/lib/core/sharedOptions.js.map +1 -0
- package/lib/core/sharedOptions.mjs +1 -0
- package/lib/core/sharedOptions.mjs.map +1 -0
- package/lib/core/sse.d.mts +116 -0
- package/lib/core/sse.d.ts +116 -0
- package/lib/core/sse.js +607 -0
- package/lib/core/sse.js.map +1 -0
- package/lib/core/sse.mjs +589 -0
- package/lib/core/sse.mjs.map +1 -0
- package/lib/core/typeUtils.d.mts +12 -0
- package/lib/core/typeUtils.d.ts +12 -0
- package/lib/core/typeUtils.js +17 -0
- package/lib/core/typeUtils.js.map +1 -0
- package/lib/core/typeUtils.mjs +1 -0
- package/lib/core/typeUtils.mjs.map +1 -0
- package/lib/core/utils/HttpResponse/decorators.d.mts +17 -0
- package/lib/core/utils/HttpResponse/decorators.d.ts +17 -0
- package/lib/core/utils/HttpResponse/decorators.js +77 -0
- package/lib/core/utils/HttpResponse/decorators.js.map +1 -0
- package/lib/core/utils/HttpResponse/decorators.mjs +47 -0
- package/lib/core/utils/HttpResponse/decorators.mjs.map +1 -0
- package/lib/core/utils/cookieStore.d.mts +13 -0
- package/lib/core/utils/cookieStore.d.ts +13 -0
- package/lib/core/utils/cookieStore.js +90 -0
- package/lib/core/utils/cookieStore.js.map +1 -0
- package/lib/core/utils/cookieStore.mjs +74 -0
- package/lib/core/utils/cookieStore.mjs.map +1 -0
- package/lib/core/utils/executeHandlers.d.mts +6 -0
- package/lib/core/utils/executeHandlers.d.ts +6 -0
- package/lib/core/utils/executeHandlers.js +50 -0
- package/lib/core/utils/executeHandlers.js.map +1 -0
- package/lib/core/utils/executeHandlers.mjs +30 -0
- package/lib/core/utils/executeHandlers.mjs.map +1 -0
- package/lib/core/utils/handleRequest.d.mts +29 -0
- package/lib/core/utils/handleRequest.d.ts +29 -0
- package/lib/core/utils/handleRequest.js +76 -0
- package/lib/core/utils/handleRequest.js.map +1 -0
- package/lib/core/utils/handleRequest.mjs +58 -0
- package/lib/core/utils/handleRequest.mjs.map +1 -0
- package/lib/core/utils/internal/Disposable.d.mts +7 -0
- package/lib/core/utils/internal/Disposable.d.ts +7 -0
- package/lib/core/utils/internal/Disposable.js +33 -0
- package/lib/core/utils/internal/Disposable.js.map +1 -0
- package/lib/core/utils/internal/Disposable.mjs +13 -0
- package/lib/core/utils/internal/Disposable.mjs.map +1 -0
- package/lib/core/utils/internal/checkGlobals.d.mts +3 -0
- package/lib/core/utils/internal/checkGlobals.d.ts +3 -0
- package/lib/core/utils/internal/checkGlobals.js +34 -0
- package/lib/core/utils/internal/checkGlobals.js.map +1 -0
- package/lib/core/utils/internal/checkGlobals.mjs +14 -0
- package/lib/core/utils/internal/checkGlobals.mjs.map +1 -0
- package/lib/core/utils/internal/devUtils.d.mts +28 -0
- package/lib/core/utils/internal/devUtils.d.ts +28 -0
- package/lib/core/utils/internal/devUtils.js +48 -0
- package/lib/core/utils/internal/devUtils.js.map +1 -0
- package/lib/core/utils/internal/devUtils.mjs +28 -0
- package/lib/core/utils/internal/devUtils.mjs.map +1 -0
- package/lib/core/utils/internal/getCallFrame.d.mts +6 -0
- package/lib/core/utils/internal/getCallFrame.d.ts +6 -0
- package/lib/core/utils/internal/getCallFrame.js +41 -0
- package/lib/core/utils/internal/getCallFrame.js.map +1 -0
- package/lib/core/utils/internal/getCallFrame.mjs +21 -0
- package/lib/core/utils/internal/getCallFrame.mjs.map +1 -0
- package/lib/core/utils/internal/hasRefCounted.d.mts +3 -0
- package/lib/core/utils/internal/hasRefCounted.d.ts +3 -0
- package/lib/core/utils/internal/hasRefCounted.js +27 -0
- package/lib/core/utils/internal/hasRefCounted.js.map +1 -0
- package/lib/core/utils/internal/hasRefCounted.mjs +7 -0
- package/lib/core/utils/internal/hasRefCounted.mjs.map +1 -0
- package/lib/core/utils/internal/isHandlerKind.d.mts +19 -0
- package/lib/core/utils/internal/isHandlerKind.d.ts +19 -0
- package/lib/core/utils/internal/isHandlerKind.js +29 -0
- package/lib/core/utils/internal/isHandlerKind.js.map +1 -0
- package/lib/core/utils/internal/isHandlerKind.mjs +9 -0
- package/lib/core/utils/internal/isHandlerKind.mjs.map +1 -0
- package/lib/core/utils/internal/isIterable.d.mts +20 -0
- package/lib/core/utils/internal/isIterable.d.ts +20 -0
- package/lib/core/utils/internal/isIterable.js +30 -0
- package/lib/core/utils/internal/isIterable.js.map +1 -0
- package/lib/core/utils/internal/isIterable.mjs +10 -0
- package/lib/core/utils/internal/isIterable.mjs.map +1 -0
- package/lib/core/utils/internal/isObject.d.mts +6 -0
- package/lib/core/utils/internal/isObject.d.ts +6 -0
- package/lib/core/utils/internal/isObject.js +27 -0
- package/lib/core/utils/internal/isObject.js.map +1 -0
- package/lib/core/utils/internal/isObject.mjs +7 -0
- package/lib/core/utils/internal/isObject.mjs.map +1 -0
- package/lib/core/utils/internal/isStringEqual.d.mts +6 -0
- package/lib/core/utils/internal/isStringEqual.d.ts +6 -0
- package/lib/core/utils/internal/isStringEqual.js +27 -0
- package/lib/core/utils/internal/isStringEqual.js.map +1 -0
- package/lib/core/utils/internal/isStringEqual.mjs +7 -0
- package/lib/core/utils/internal/isStringEqual.mjs.map +1 -0
- package/lib/core/utils/internal/jsonParse.d.mts +7 -0
- package/lib/core/utils/internal/jsonParse.d.ts +7 -0
- package/lib/core/utils/internal/jsonParse.js +31 -0
- package/lib/core/utils/internal/jsonParse.js.map +1 -0
- package/lib/core/utils/internal/jsonParse.mjs +11 -0
- package/lib/core/utils/internal/jsonParse.mjs.map +1 -0
- package/lib/core/utils/internal/mergeRight.d.mts +7 -0
- package/lib/core/utils/internal/mergeRight.d.ts +7 -0
- package/lib/core/utils/internal/mergeRight.js +43 -0
- package/lib/core/utils/internal/mergeRight.js.map +1 -0
- package/lib/core/utils/internal/mergeRight.mjs +23 -0
- package/lib/core/utils/internal/mergeRight.mjs.map +1 -0
- package/lib/core/utils/internal/parseGraphQLRequest.d.mts +6 -0
- package/lib/core/utils/internal/parseGraphQLRequest.d.ts +6 -0
- package/lib/core/utils/internal/parseGraphQLRequest.js +146 -0
- package/lib/core/utils/internal/parseGraphQLRequest.js.map +1 -0
- package/lib/core/utils/internal/parseGraphQLRequest.mjs +129 -0
- package/lib/core/utils/internal/parseGraphQLRequest.mjs.map +1 -0
- package/lib/core/utils/internal/parseMultipartData.d.mts +14 -0
- package/lib/core/utils/internal/parseMultipartData.d.ts +14 -0
- package/lib/core/utils/internal/parseMultipartData.js +83 -0
- package/lib/core/utils/internal/parseMultipartData.js.map +1 -0
- package/lib/core/utils/internal/parseMultipartData.mjs +63 -0
- package/lib/core/utils/internal/parseMultipartData.mjs.map +1 -0
- package/lib/core/utils/internal/pipeEvents.d.mts +8 -0
- package/lib/core/utils/internal/pipeEvents.d.ts +8 -0
- package/lib/core/utils/internal/pipeEvents.js +36 -0
- package/lib/core/utils/internal/pipeEvents.js.map +1 -0
- package/lib/core/utils/internal/pipeEvents.mjs +16 -0
- package/lib/core/utils/internal/pipeEvents.mjs.map +1 -0
- package/lib/core/utils/internal/requestHandlerUtils.d.mts +12 -0
- package/lib/core/utils/internal/requestHandlerUtils.d.ts +12 -0
- package/lib/core/utils/internal/requestHandlerUtils.js +37 -0
- package/lib/core/utils/internal/requestHandlerUtils.js.map +1 -0
- package/lib/core/utils/internal/requestHandlerUtils.mjs +17 -0
- package/lib/core/utils/internal/requestHandlerUtils.mjs.map +1 -0
- package/lib/core/utils/internal/toReadonlyArray.d.mts +6 -0
- package/lib/core/utils/internal/toReadonlyArray.d.ts +6 -0
- package/lib/core/utils/internal/toReadonlyArray.js +29 -0
- package/lib/core/utils/internal/toReadonlyArray.js.map +1 -0
- package/lib/core/utils/internal/toReadonlyArray.mjs +9 -0
- package/lib/core/utils/internal/toReadonlyArray.mjs.map +1 -0
- package/lib/core/utils/internal/tryCatch.d.mts +3 -0
- package/lib/core/utils/internal/tryCatch.d.ts +3 -0
- package/lib/core/utils/internal/tryCatch.js +32 -0
- package/lib/core/utils/internal/tryCatch.js.map +1 -0
- package/lib/core/utils/internal/tryCatch.mjs +12 -0
- package/lib/core/utils/internal/tryCatch.mjs.map +1 -0
- package/lib/core/utils/logging/getStatusCodeColor.d.mts +11 -0
- package/lib/core/utils/logging/getStatusCodeColor.d.ts +11 -0
- package/lib/core/utils/logging/getStatusCodeColor.js +40 -0
- package/lib/core/utils/logging/getStatusCodeColor.js.map +1 -0
- package/lib/core/utils/logging/getStatusCodeColor.mjs +20 -0
- package/lib/core/utils/logging/getStatusCodeColor.mjs.map +1 -0
- package/lib/core/utils/logging/getTimestamp.d.mts +9 -0
- package/lib/core/utils/logging/getTimestamp.d.ts +9 -0
- package/lib/core/utils/logging/getTimestamp.js +32 -0
- package/lib/core/utils/logging/getTimestamp.js.map +1 -0
- package/lib/core/utils/logging/getTimestamp.mjs +12 -0
- package/lib/core/utils/logging/getTimestamp.mjs.map +1 -0
- package/lib/core/utils/logging/serializeRequest.d.mts +12 -0
- package/lib/core/utils/logging/serializeRequest.d.ts +12 -0
- package/lib/core/utils/logging/serializeRequest.js +34 -0
- package/lib/core/utils/logging/serializeRequest.js.map +1 -0
- package/lib/core/utils/logging/serializeRequest.mjs +14 -0
- package/lib/core/utils/logging/serializeRequest.mjs.map +1 -0
- package/lib/core/utils/logging/serializeResponse.d.mts +9 -0
- package/lib/core/utils/logging/serializeResponse.d.ts +9 -0
- package/lib/core/utils/logging/serializeResponse.js +48 -0
- package/lib/core/utils/logging/serializeResponse.js.map +1 -0
- package/lib/core/utils/logging/serializeResponse.mjs +18 -0
- package/lib/core/utils/logging/serializeResponse.mjs.map +1 -0
- package/lib/core/utils/matching/matchRequestUrl.d.mts +20 -0
- package/lib/core/utils/matching/matchRequestUrl.d.ts +20 -0
- package/lib/core/utils/matching/matchRequestUrl.js +55 -0
- package/lib/core/utils/matching/matchRequestUrl.js.map +1 -0
- package/lib/core/utils/matching/matchRequestUrl.mjs +35 -0
- package/lib/core/utils/matching/matchRequestUrl.mjs.map +1 -0
- package/lib/core/utils/matching/normalizePath.d.mts +13 -0
- package/lib/core/utils/matching/normalizePath.d.ts +13 -0
- package/lib/core/utils/matching/normalizePath.js +33 -0
- package/lib/core/utils/matching/normalizePath.js.map +1 -0
- package/lib/core/utils/matching/normalizePath.mjs +13 -0
- package/lib/core/utils/matching/normalizePath.mjs.map +1 -0
- package/lib/core/utils/request/getAllAcceptedMimeTypes.d.mts +14 -0
- package/lib/core/utils/request/getAllAcceptedMimeTypes.d.ts +14 -0
- package/lib/core/utils/request/getAllAcceptedMimeTypes.js +61 -0
- package/lib/core/utils/request/getAllAcceptedMimeTypes.js.map +1 -0
- package/lib/core/utils/request/getAllAcceptedMimeTypes.mjs +41 -0
- package/lib/core/utils/request/getAllAcceptedMimeTypes.mjs.map +1 -0
- package/lib/core/utils/request/getRequestCookies.d.mts +3 -0
- package/lib/core/utils/request/getRequestCookies.d.ts +3 -0
- package/lib/core/utils/request/getRequestCookies.js +79 -0
- package/lib/core/utils/request/getRequestCookies.js.map +1 -0
- package/lib/core/utils/request/getRequestCookies.mjs +62 -0
- package/lib/core/utils/request/getRequestCookies.mjs.map +1 -0
- package/lib/core/utils/request/onUnhandledRequest.d.mts +9 -0
- package/lib/core/utils/request/onUnhandledRequest.d.ts +9 -0
- package/lib/core/utils/request/onUnhandledRequest.js +76 -0
- package/lib/core/utils/request/onUnhandledRequest.js.map +1 -0
- package/lib/core/utils/request/onUnhandledRequest.mjs +56 -0
- package/lib/core/utils/request/onUnhandledRequest.mjs.map +1 -0
- package/lib/core/utils/request/storeResponseCookies.d.mts +3 -0
- package/lib/core/utils/request/storeResponseCookies.d.ts +3 -0
- package/lib/core/utils/request/storeResponseCookies.js +32 -0
- package/lib/core/utils/request/storeResponseCookies.js.map +1 -0
- package/lib/core/utils/request/storeResponseCookies.mjs +12 -0
- package/lib/core/utils/request/storeResponseCookies.mjs.map +1 -0
- package/lib/core/utils/request/toPublicUrl.d.mts +7 -0
- package/lib/core/utils/request/toPublicUrl.d.ts +7 -0
- package/lib/core/utils/request/toPublicUrl.js +31 -0
- package/lib/core/utils/request/toPublicUrl.js.map +1 -0
- package/lib/core/utils/request/toPublicUrl.mjs +11 -0
- package/lib/core/utils/request/toPublicUrl.mjs.map +1 -0
- package/lib/core/utils/toResponseInit.d.mts +3 -0
- package/lib/core/utils/toResponseInit.d.ts +3 -0
- package/lib/core/utils/toResponseInit.js +31 -0
- package/lib/core/utils/toResponseInit.js.map +1 -0
- package/lib/core/utils/toResponseInit.mjs +11 -0
- package/lib/core/utils/toResponseInit.mjs.map +1 -0
- package/lib/core/utils/url/cleanUrl.d.mts +7 -0
- package/lib/core/utils/url/cleanUrl.d.ts +7 -0
- package/lib/core/utils/url/cleanUrl.js +31 -0
- package/lib/core/utils/url/cleanUrl.js.map +1 -0
- package/lib/core/utils/url/cleanUrl.mjs +11 -0
- package/lib/core/utils/url/cleanUrl.mjs.map +1 -0
- package/lib/core/utils/url/getAbsoluteUrl.d.mts +6 -0
- package/lib/core/utils/url/getAbsoluteUrl.d.ts +6 -0
- package/lib/core/utils/url/getAbsoluteUrl.js +38 -0
- package/lib/core/utils/url/getAbsoluteUrl.js.map +1 -0
- package/lib/core/utils/url/getAbsoluteUrl.mjs +18 -0
- package/lib/core/utils/url/getAbsoluteUrl.mjs.map +1 -0
- package/lib/core/utils/url/isAbsoluteUrl.d.mts +6 -0
- package/lib/core/utils/url/isAbsoluteUrl.d.ts +6 -0
- package/lib/core/utils/url/isAbsoluteUrl.js +27 -0
- package/lib/core/utils/url/isAbsoluteUrl.js.map +1 -0
- package/lib/core/utils/url/isAbsoluteUrl.mjs +7 -0
- package/lib/core/utils/url/isAbsoluteUrl.mjs.map +1 -0
- package/lib/core/ws/WebSocketClientManager.d.mts +65 -0
- package/lib/core/ws/WebSocketClientManager.d.ts +65 -0
- package/lib/core/ws/WebSocketClientManager.js +159 -0
- package/lib/core/ws/WebSocketClientManager.js.map +1 -0
- package/lib/core/ws/WebSocketClientManager.mjs +139 -0
- package/lib/core/ws/WebSocketClientManager.mjs.map +1 -0
- package/lib/core/ws/WebSocketClientStore.d.mts +13 -0
- package/lib/core/ws/WebSocketClientStore.d.ts +13 -0
- package/lib/core/ws/WebSocketClientStore.js +26 -0
- package/lib/core/ws/WebSocketClientStore.js.map +1 -0
- package/lib/core/ws/WebSocketClientStore.mjs +6 -0
- package/lib/core/ws/WebSocketClientStore.mjs.map +1 -0
- package/lib/core/ws/WebSocketIndexedDBClientStore.d.mts +14 -0
- package/lib/core/ws/WebSocketIndexedDBClientStore.d.ts +14 -0
- package/lib/core/ws/WebSocketIndexedDBClientStore.js +130 -0
- package/lib/core/ws/WebSocketIndexedDBClientStore.js.map +1 -0
- package/lib/core/ws/WebSocketIndexedDBClientStore.mjs +110 -0
- package/lib/core/ws/WebSocketIndexedDBClientStore.mjs.map +1 -0
- package/lib/core/ws/WebSocketMemoryClientStore.d.mts +12 -0
- package/lib/core/ws/WebSocketMemoryClientStore.d.ts +12 -0
- package/lib/core/ws/WebSocketMemoryClientStore.js +41 -0
- package/lib/core/ws/WebSocketMemoryClientStore.js.map +1 -0
- package/lib/core/ws/WebSocketMemoryClientStore.mjs +21 -0
- package/lib/core/ws/WebSocketMemoryClientStore.mjs.map +1 -0
- package/lib/core/ws/handleWebSocketEvent.d.mts +20 -0
- package/lib/core/ws/handleWebSocketEvent.d.ts +20 -0
- package/lib/core/ws/handleWebSocketEvent.js +61 -0
- package/lib/core/ws/handleWebSocketEvent.js.map +1 -0
- package/lib/core/ws/handleWebSocketEvent.mjs +43 -0
- package/lib/core/ws/handleWebSocketEvent.mjs.map +1 -0
- package/lib/core/ws/utils/attachWebSocketLogger.d.mts +18 -0
- package/lib/core/ws/utils/attachWebSocketLogger.d.ts +18 -0
- package/lib/core/ws/utils/attachWebSocketLogger.js +199 -0
- package/lib/core/ws/utils/attachWebSocketLogger.js.map +1 -0
- package/lib/core/ws/utils/attachWebSocketLogger.mjs +179 -0
- package/lib/core/ws/utils/attachWebSocketLogger.mjs.map +1 -0
- package/lib/core/ws/utils/getMessageLength.d.mts +11 -0
- package/lib/core/ws/utils/getMessageLength.d.ts +11 -0
- package/lib/core/ws/utils/getMessageLength.js +34 -0
- package/lib/core/ws/utils/getMessageLength.js.map +1 -0
- package/lib/core/ws/utils/getMessageLength.mjs +14 -0
- package/lib/core/ws/utils/getMessageLength.mjs.map +1 -0
- package/lib/core/ws/utils/getPublicData.d.mts +5 -0
- package/lib/core/ws/utils/getPublicData.d.ts +5 -0
- package/lib/core/ws/utils/getPublicData.js +37 -0
- package/lib/core/ws/utils/getPublicData.js.map +1 -0
- package/lib/core/ws/utils/getPublicData.mjs +17 -0
- package/lib/core/ws/utils/getPublicData.mjs.map +1 -0
- package/lib/core/ws/utils/truncateMessage.d.mts +3 -0
- package/lib/core/ws/utils/truncateMessage.d.ts +3 -0
- package/lib/core/ws/utils/truncateMessage.js +31 -0
- package/lib/core/ws/utils/truncateMessage.js.map +1 -0
- package/lib/core/ws/utils/truncateMessage.mjs +11 -0
- package/lib/core/ws/utils/truncateMessage.mjs.map +1 -0
- package/lib/core/ws/webSocketInterceptor.d.mts +5 -0
- package/lib/core/ws/webSocketInterceptor.d.ts +5 -0
- package/lib/core/ws/webSocketInterceptor.js +26 -0
- package/lib/core/ws/webSocketInterceptor.js.map +1 -0
- package/lib/core/ws/webSocketInterceptor.mjs +6 -0
- package/lib/core/ws/webSocketInterceptor.mjs.map +1 -0
- package/lib/core/ws.d.mts +75 -0
- package/lib/core/ws.d.ts +75 -0
- package/lib/core/ws.js +69 -0
- package/lib/core/ws.js.map +1 -0
- package/lib/core/ws.mjs +52 -0
- package/lib/core/ws.mjs.map +1 -0
- package/lib/iife/index.js +23752 -0
- package/lib/iife/index.js.map +1 -0
- package/lib/mockServiceWorker.js +349 -0
- package/lib/native/index.d.mts +74 -0
- package/lib/native/index.d.ts +74 -0
- package/lib/native/index.js +156 -0
- package/lib/native/index.js.map +1 -0
- package/lib/native/index.mjs +134 -0
- package/lib/native/index.mjs.map +1 -0
- package/lib/node/index.d.mts +91 -0
- package/lib/node/index.d.ts +91 -0
- package/lib/node/index.js +209 -0
- package/lib/node/index.js.map +1 -0
- package/lib/node/index.mjs +184 -0
- package/lib/node/index.mjs.map +1 -0
- package/lib/shims/cookie.d.mts +7 -0
- package/lib/shims/cookie.d.ts +7 -0
- package/lib/shims/cookie.js +204 -0
- package/lib/shims/cookie.mjs +196 -0
- package/lib/shims/statuses.d.mts +6 -0
- package/lib/shims/statuses.d.ts +6 -0
- package/lib/shims/statuses.js +195 -0
- package/lib/shims/statuses.mjs +187 -0
- package/native/package.json +30 -0
- package/node/package.json +33 -0
- package/package.json +381 -0
- package/src/browser/global.browser.d.ts +1 -0
- package/src/browser/index.ts +3 -0
- package/src/browser/setupWorker/glossary.ts +138 -0
- package/src/browser/setupWorker/setupWorker.node.test.ts +10 -0
- package/src/browser/setupWorker/setupWorker.ts +184 -0
- package/src/browser/setupWorker/start/createFallbackRequestListener.ts +71 -0
- package/src/browser/setupWorker/start/createRequestListener.ts +138 -0
- package/src/browser/setupWorker/start/createResponseListener.ts +57 -0
- package/src/browser/setupWorker/start/createStartHandler.ts +137 -0
- package/src/browser/setupWorker/start/utils/enableMocking.ts +30 -0
- package/src/browser/setupWorker/start/utils/getWorkerByRegistration.ts +25 -0
- package/src/browser/setupWorker/start/utils/getWorkerInstance.ts +97 -0
- package/src/browser/setupWorker/start/utils/prepareStartHandler.test.ts +59 -0
- package/src/browser/setupWorker/start/utils/prepareStartHandler.ts +44 -0
- package/src/browser/setupWorker/start/utils/printStartMessage.test.ts +84 -0
- package/src/browser/setupWorker/start/utils/printStartMessage.ts +51 -0
- package/src/browser/setupWorker/start/utils/validateWorkerScope.ts +18 -0
- package/src/browser/setupWorker/stop/utils/printStopMessage.test.ts +26 -0
- package/src/browser/setupWorker/stop/utils/printStopMessage.ts +13 -0
- package/src/browser/tsconfig.browser.build.json +6 -0
- package/src/browser/tsconfig.browser.json +9 -0
- package/src/browser/utils/checkWorkerIntegrity.ts +42 -0
- package/src/browser/utils/deserializeRequest.ts +15 -0
- package/src/browser/utils/getAbsoluteWorkerUrl.test.ts +29 -0
- package/src/browser/utils/getAbsoluteWorkerUrl.ts +7 -0
- package/src/browser/utils/pruneGetRequestBody.test.ts +53 -0
- package/src/browser/utils/pruneGetRequestBody.ts +21 -0
- package/src/browser/utils/supports.ts +30 -0
- package/src/browser/utils/workerChannel.ts +159 -0
- package/src/core/HttpResponse.test.ts +378 -0
- package/src/core/HttpResponse.ts +248 -0
- package/src/core/SetupApi.ts +127 -0
- package/src/core/bypass.test.ts +80 -0
- package/src/core/bypass.ts +46 -0
- package/src/core/delay.ts +82 -0
- package/src/core/getResponse.test.ts +74 -0
- package/src/core/getResponse.ts +29 -0
- package/src/core/graphql.test.ts +11 -0
- package/src/core/graphql.ts +136 -0
- package/src/core/handlers/GraphQLHandler.test.ts +873 -0
- package/src/core/handlers/GraphQLHandler.ts +437 -0
- package/src/core/handlers/HttpHandler.test.ts +253 -0
- package/src/core/handlers/HttpHandler.ts +214 -0
- package/src/core/handlers/RequestHandler.ts +391 -0
- package/src/core/handlers/WebSocketHandler.test.ts +127 -0
- package/src/core/handlers/WebSocketHandler.ts +209 -0
- package/src/core/handlers/common.ts +1 -0
- package/src/core/http.test.ts +15 -0
- package/src/core/http.ts +64 -0
- package/src/core/index.ts +110 -0
- package/src/core/isCommonAssetRequest.ts +45 -0
- package/src/core/passthrough.test.ts +11 -0
- package/src/core/passthrough.ts +25 -0
- package/src/core/sharedOptions.ts +66 -0
- package/src/core/sse.ts +916 -0
- package/src/core/typeUtils.ts +26 -0
- package/src/core/utils/HttpResponse/decorators.ts +76 -0
- package/src/core/utils/cookieStore.ts +94 -0
- package/src/core/utils/executeHandlers.ts +69 -0
- package/src/core/utils/handleRequest.test.ts +573 -0
- package/src/core/utils/handleRequest.ts +117 -0
- package/src/core/utils/internal/Disposable.ts +12 -0
- package/src/core/utils/internal/checkGlobals.ts +17 -0
- package/src/core/utils/internal/devUtils.test.ts +21 -0
- package/src/core/utils/internal/devUtils.ts +44 -0
- package/src/core/utils/internal/getCallFrame.test.ts +154 -0
- package/src/core/utils/internal/getCallFrame.ts +35 -0
- package/src/core/utils/internal/hasRefCounted.test.ts +16 -0
- package/src/core/utils/internal/hasRefCounted.ts +8 -0
- package/src/core/utils/internal/isHandlerKind.test.ts +64 -0
- package/src/core/utils/internal/isHandlerKind.ts +21 -0
- package/src/core/utils/internal/isIterable.test.ts +23 -0
- package/src/core/utils/internal/isIterable.ts +32 -0
- package/src/core/utils/internal/isObject.test.ts +20 -0
- package/src/core/utils/internal/isObject.ts +6 -0
- package/src/core/utils/internal/isStringEqual.test.ts +45 -0
- package/src/core/utils/internal/isStringEqual.ts +6 -0
- package/src/core/utils/internal/jsonParse.test.ts +13 -0
- package/src/core/utils/internal/jsonParse.ts +13 -0
- package/src/core/utils/internal/mergeRight.test.ts +43 -0
- package/src/core/utils/internal/mergeRight.ts +30 -0
- package/src/core/utils/internal/parseGraphQLRequest.test.ts +99 -0
- package/src/core/utils/internal/parseGraphQLRequest.ts +214 -0
- package/src/core/utils/internal/parseMultipartData.test.ts +76 -0
- package/src/core/utils/internal/parseMultipartData.ts +106 -0
- package/src/core/utils/internal/pipeEvents.test.ts +14 -0
- package/src/core/utils/internal/pipeEvents.ts +25 -0
- package/src/core/utils/internal/requestHandlerUtils.ts +21 -0
- package/src/core/utils/internal/toReadonlyArray.test.ts +30 -0
- package/src/core/utils/internal/toReadonlyArray.ts +8 -0
- package/src/core/utils/internal/tryCatch.test.ts +29 -0
- package/src/core/utils/internal/tryCatch.ts +11 -0
- package/src/core/utils/logging/getStatusCodeColor.test.ts +22 -0
- package/src/core/utils/logging/getStatusCodeColor.ts +20 -0
- package/src/core/utils/logging/getTimestamp.test.ts +32 -0
- package/src/core/utils/logging/getTimestamp.ts +17 -0
- package/src/core/utils/logging/serializeRequest.test.ts +23 -0
- package/src/core/utils/logging/serializeRequest.ts +23 -0
- package/src/core/utils/logging/serializeResponse.test.ts +77 -0
- package/src/core/utils/logging/serializeResponse.ts +31 -0
- package/src/core/utils/matching/matchRequestUrl.test.ts +183 -0
- package/src/core/utils/matching/matchRequestUrl.ts +77 -0
- package/src/core/utils/matching/normalizePath.node.test.ts +44 -0
- package/src/core/utils/matching/normalizePath.test.ts +56 -0
- package/src/core/utils/matching/normalizePath.ts +22 -0
- package/src/core/utils/request/getAllAcceptedMimeTypes.test.ts +86 -0
- package/src/core/utils/request/getAllAcceptedMimeTypes.ts +70 -0
- package/src/core/utils/request/getRequestCookies.ts +88 -0
- package/src/core/utils/request/onUnhandledRequest.node.test.ts +62 -0
- package/src/core/utils/request/onUnhandledRequest.test.ts +228 -0
- package/src/core/utils/request/onUnhandledRequest.ts +81 -0
- package/src/core/utils/request/storeResponseCookies.ts +17 -0
- package/src/core/utils/request/toPublicUrl.node.test.ts +17 -0
- package/src/core/utils/request/toPublicUrl.test.ts +16 -0
- package/src/core/utils/request/toPublicUrl.ts +16 -0
- package/src/core/utils/toResponseInit.ts +7 -0
- package/src/core/utils/url/cleanUrl.test.ts +22 -0
- package/src/core/utils/url/cleanUrl.ts +16 -0
- package/src/core/utils/url/getAbsoluteUrl.node.test.ts +19 -0
- package/src/core/utils/url/getAbsoluteUrl.test.ts +47 -0
- package/src/core/utils/url/getAbsoluteUrl.ts +25 -0
- package/src/core/utils/url/isAbsoluteUrl.test.ts +32 -0
- package/src/core/utils/url/isAbsoluteUrl.ts +6 -0
- package/src/core/ws/WebSocketClientManager.test.ts +164 -0
- package/src/core/ws/WebSocketClientManager.ts +241 -0
- package/src/core/ws/WebSocketClientStore.ts +14 -0
- package/src/core/ws/WebSocketIndexedDBClientStore.ts +140 -0
- package/src/core/ws/WebSocketMemoryClientStore.ts +27 -0
- package/src/core/ws/handleWebSocketEvent.ts +64 -0
- package/src/core/ws/utils/attachWebSocketLogger.ts +245 -0
- package/src/core/ws/utils/getMessageLength.test.ts +16 -0
- package/src/core/ws/utils/getMessageLength.ts +20 -0
- package/src/core/ws/utils/getPublicData.test.ts +38 -0
- package/src/core/ws/utils/getPublicData.ts +18 -0
- package/src/core/ws/utils/truncateMessage.test.ts +12 -0
- package/src/core/ws/utils/truncateMessage.ts +9 -0
- package/src/core/ws/webSocketInterceptor.ts +3 -0
- package/src/core/ws.test.ts +23 -0
- package/src/core/ws.ts +161 -0
- package/src/iife/index.ts +2 -0
- package/src/mockServiceWorker.js +349 -0
- package/src/native/index.ts +21 -0
- package/src/node/SetupServerApi.ts +87 -0
- package/src/node/SetupServerCommonApi.ts +169 -0
- package/src/node/glossary.ts +74 -0
- package/src/node/index.ts +3 -0
- package/src/node/setupServer.ts +15 -0
- package/src/package.json +3 -0
- package/src/shims/cookie.ts +7 -0
- package/src/shims/statuses.ts +6 -0
- package/src/tsconfig.core.build.json +6 -0
- package/src/tsconfig.node.build.json +6 -0
- package/src/tsconfig.node.json +8 -0
- package/src/tsconfig.src.json +10 -0
- package/src/tsconfig.worker.json +13 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns all accepted mime types, ordered by precedence as defined
|
|
3
|
+
* in [RFC 7231 Section 5.3.2](https://datatracker.ietf.org/doc/html/rfc7231#section-5.3.2).
|
|
4
|
+
*
|
|
5
|
+
* Precedence rules (highest to lowest):
|
|
6
|
+
* 1. Quality value (`q` parameter, default 1).
|
|
7
|
+
* 2. Specificity: `type/subtype` > `type/*` > `*\/*`.
|
|
8
|
+
* 3. Number of media type parameters (more = more specific).
|
|
9
|
+
*
|
|
10
|
+
* Types with `q=0` are excluded (explicitly not acceptable).
|
|
11
|
+
*/
|
|
12
|
+
export function getAllAcceptedMimeTypes(
|
|
13
|
+
acceptHeader: string | null,
|
|
14
|
+
): Array<string> {
|
|
15
|
+
if (acceptHeader == null) {
|
|
16
|
+
return []
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const accepted: Array<{
|
|
20
|
+
type: string
|
|
21
|
+
quality: number
|
|
22
|
+
specificity: number
|
|
23
|
+
parameterCount: number
|
|
24
|
+
}> = []
|
|
25
|
+
|
|
26
|
+
for (const part of acceptHeader.split(',')) {
|
|
27
|
+
const [type, ...params] = part.split(';').map((v) => v.trim())
|
|
28
|
+
|
|
29
|
+
let quality = 1
|
|
30
|
+
let parameterCount = 0
|
|
31
|
+
|
|
32
|
+
for (const param of params) {
|
|
33
|
+
const [key, value] = param.split('=').map((v) => v.trim())
|
|
34
|
+
|
|
35
|
+
if (key === 'q') {
|
|
36
|
+
quality = Number(value)
|
|
37
|
+
} else {
|
|
38
|
+
parameterCount++
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// RFC 7231: a quality value of 0 indicates "not acceptable".
|
|
43
|
+
if (quality === 0) {
|
|
44
|
+
continue
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const [mediaType, mediaSubtype] = type.split('/')
|
|
48
|
+
const specificity = mediaType === '*' ? 0 : mediaSubtype === '*' ? 1 : 2
|
|
49
|
+
|
|
50
|
+
accepted.push({ type, quality, specificity, parameterCount })
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (!accepted.length) {
|
|
54
|
+
return []
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return accepted
|
|
58
|
+
.sort((left, right) => {
|
|
59
|
+
if (right.quality !== left.quality) {
|
|
60
|
+
return right.quality - left.quality
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if (right.specificity !== left.specificity) {
|
|
64
|
+
return right.specificity - left.specificity
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return right.parameterCount - left.parameterCount
|
|
68
|
+
})
|
|
69
|
+
.map((entry) => entry.type)
|
|
70
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import {
|
|
2
|
+
parse as parseCookie,
|
|
3
|
+
serialize as serializeCookie,
|
|
4
|
+
} from '../../../shims/cookie'
|
|
5
|
+
import { cookieStore } from '../cookieStore'
|
|
6
|
+
|
|
7
|
+
function parseCookies(input: string): Record<string, string> {
|
|
8
|
+
const parsedCookies = parseCookie(input)
|
|
9
|
+
const cookies: Record<string, string> = {}
|
|
10
|
+
|
|
11
|
+
for (const cookieName in parsedCookies) {
|
|
12
|
+
if (typeof parsedCookies[cookieName] !== 'undefined') {
|
|
13
|
+
cookies[cookieName] = parsedCookies[cookieName]
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return cookies
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function getAllDocumentCookies() {
|
|
21
|
+
return parseCookies(document.cookie)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function getDocumentCookies(request: Request): Record<string, string> {
|
|
25
|
+
if (typeof document === 'undefined' || typeof location === 'undefined') {
|
|
26
|
+
return {}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
switch (request.credentials) {
|
|
30
|
+
case 'same-origin': {
|
|
31
|
+
const requestUrl = new URL(request.url)
|
|
32
|
+
|
|
33
|
+
// Return document cookies only when requested a resource
|
|
34
|
+
// from the same origin as the current document.
|
|
35
|
+
return location.origin === requestUrl.origin
|
|
36
|
+
? getAllDocumentCookies()
|
|
37
|
+
: {}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
case 'include': {
|
|
41
|
+
// Return all document cookies.
|
|
42
|
+
return getAllDocumentCookies()
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
default: {
|
|
46
|
+
return {}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function getAllRequestCookies(request: Request): Record<string, string> {
|
|
52
|
+
/**
|
|
53
|
+
* @note While the "cookie" header is a forbidden header field
|
|
54
|
+
* in the browser, you can read it in Node.js. We need to respect
|
|
55
|
+
* it for mocking in Node.js.
|
|
56
|
+
*/
|
|
57
|
+
const requestCookieHeader = request.headers.get('cookie')
|
|
58
|
+
const cookiesFromHeaders = requestCookieHeader
|
|
59
|
+
? parseCookies(requestCookieHeader)
|
|
60
|
+
: {}
|
|
61
|
+
|
|
62
|
+
const cookiesFromDocument = getDocumentCookies(request)
|
|
63
|
+
|
|
64
|
+
// Forward the document cookies to the request headers.
|
|
65
|
+
for (const name in cookiesFromDocument) {
|
|
66
|
+
request.headers.append(
|
|
67
|
+
'cookie',
|
|
68
|
+
serializeCookie(name, cookiesFromDocument[name]),
|
|
69
|
+
)
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const cookiesFromStore = cookieStore.getCookies(request.url)
|
|
73
|
+
const storedCookiesObject = Object.fromEntries(
|
|
74
|
+
cookiesFromStore.map((cookie) => [cookie.key, cookie.value]),
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
// Forward the raw stored cookies to request headers
|
|
78
|
+
// so they contain metadata like "expires", "secure", etc.
|
|
79
|
+
for (const cookie of cookiesFromStore) {
|
|
80
|
+
request.headers.append('cookie', cookie.toString())
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return {
|
|
84
|
+
...cookiesFromDocument,
|
|
85
|
+
...storedCookiesObject,
|
|
86
|
+
...cookiesFromHeaders,
|
|
87
|
+
}
|
|
88
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
// @vitest-environment node
|
|
2
|
+
import { onUnhandledRequest } from './onUnhandledRequest'
|
|
3
|
+
|
|
4
|
+
const fixtures = {
|
|
5
|
+
warningWithoutSuggestions: (url = `/api`) => `\
|
|
6
|
+
[MSW] Warning: intercepted a request without a matching request handler:
|
|
7
|
+
|
|
8
|
+
• GET ${url}
|
|
9
|
+
|
|
10
|
+
If you still wish to intercept this unhandled request, please create a request handler for it.
|
|
11
|
+
Read more: https://mswjs.io/docs/http/intercepting-requests`,
|
|
12
|
+
warningWithResponseBody: (url = `/api`) => `\
|
|
13
|
+
[MSW] Warning: intercepted a request without a matching request handler:
|
|
14
|
+
|
|
15
|
+
• POST ${url}
|
|
16
|
+
|
|
17
|
+
• Request body: {"variables":{"id":"abc-123"},"query":"query UserName($id: String!) { user(id: $id) { name } }"}
|
|
18
|
+
|
|
19
|
+
If you still wish to intercept this unhandled request, please create a request handler for it.
|
|
20
|
+
Read more: https://mswjs.io/docs/http/intercepting-requests`,
|
|
21
|
+
|
|
22
|
+
errorWithoutSuggestions: `\
|
|
23
|
+
[MSW] Error: intercepted a request without a matching request handler:
|
|
24
|
+
|
|
25
|
+
• GET /api
|
|
26
|
+
|
|
27
|
+
If you still wish to intercept this unhandled request, please create a request handler for it.
|
|
28
|
+
Read more: https://mswjs.io/docs/http/intercepting-requests`,
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
beforeAll(() => {
|
|
32
|
+
vi.spyOn(console, 'warn').mockImplementation(() => void 0)
|
|
33
|
+
vi.spyOn(console, 'error').mockImplementation(() => void 0)
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
afterEach(() => {
|
|
37
|
+
vi.clearAllMocks()
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
afterAll(() => {
|
|
41
|
+
vi.restoreAllMocks()
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
test('prints with an absolute URL and search params', async () => {
|
|
45
|
+
await onUnhandledRequest(
|
|
46
|
+
new Request(new URL('https://mswjs.io/api?foo=boo')),
|
|
47
|
+
'warn',
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
expect(console.warn).toHaveBeenCalledWith(
|
|
51
|
+
fixtures.warningWithoutSuggestions(`https://mswjs.io/api?foo=boo`),
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
await onUnhandledRequest(
|
|
55
|
+
new Request(new URL('http://localhost/api?foo=boo')),
|
|
56
|
+
'warn',
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
expect(console.warn).toHaveBeenCalledWith(
|
|
60
|
+
fixtures.warningWithoutSuggestions(`http://localhost/api?foo=boo`),
|
|
61
|
+
)
|
|
62
|
+
})
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
// @vitest-environment jsdom
|
|
2
|
+
import {
|
|
3
|
+
onUnhandledRequest,
|
|
4
|
+
UnhandledRequestCallback,
|
|
5
|
+
} from './onUnhandledRequest'
|
|
6
|
+
|
|
7
|
+
const fixtures = {
|
|
8
|
+
warningWithoutSuggestions: (url = `/api`) => `\
|
|
9
|
+
[MSW] Warning: intercepted a request without a matching request handler:
|
|
10
|
+
|
|
11
|
+
• GET ${url}
|
|
12
|
+
|
|
13
|
+
If you still wish to intercept this unhandled request, please create a request handler for it.
|
|
14
|
+
Read more: https://mswjs.io/docs/http/intercepting-requests`,
|
|
15
|
+
warningWithResponseBody: (url = `/api`) => `\
|
|
16
|
+
[MSW] Warning: intercepted a request without a matching request handler:
|
|
17
|
+
|
|
18
|
+
• POST ${url}
|
|
19
|
+
|
|
20
|
+
• Request body: {"variables":{"id":"abc-123"},"query":"query UserName($id: String!) { user(id: $id) { name } }"}
|
|
21
|
+
|
|
22
|
+
If you still wish to intercept this unhandled request, please create a request handler for it.
|
|
23
|
+
Read more: https://mswjs.io/docs/http/intercepting-requests`,
|
|
24
|
+
|
|
25
|
+
errorWithoutSuggestions: `\
|
|
26
|
+
[MSW] Error: intercepted a request without a matching request handler:
|
|
27
|
+
|
|
28
|
+
• GET /api
|
|
29
|
+
|
|
30
|
+
If you still wish to intercept this unhandled request, please create a request handler for it.
|
|
31
|
+
Read more: https://mswjs.io/docs/http/intercepting-requests`,
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
beforeEach(() => {
|
|
35
|
+
vi.spyOn(console, 'warn').mockImplementation(() => void 0)
|
|
36
|
+
vi.spyOn(console, 'error').mockImplementation(() => void 0)
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
afterEach(() => {
|
|
40
|
+
vi.restoreAllMocks()
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
test('supports the "bypass" request strategy', async () => {
|
|
44
|
+
await onUnhandledRequest(
|
|
45
|
+
new Request(new URL('http://localhost/api')),
|
|
46
|
+
'bypass',
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
expect(console.warn).not.toHaveBeenCalled()
|
|
50
|
+
expect(console.error).not.toHaveBeenCalled()
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
test('supports the "warn" request strategy', async () => {
|
|
54
|
+
await onUnhandledRequest(new Request(new URL('http://localhost/api')), 'warn')
|
|
55
|
+
|
|
56
|
+
expect(console.warn).toHaveBeenCalledWith(
|
|
57
|
+
fixtures.warningWithoutSuggestions(),
|
|
58
|
+
)
|
|
59
|
+
})
|
|
60
|
+
|
|
61
|
+
test('supports the "warn" request strategy with request body', async () => {
|
|
62
|
+
await onUnhandledRequest(
|
|
63
|
+
new Request(new URL('http://localhost/api'), {
|
|
64
|
+
method: 'POST',
|
|
65
|
+
headers: {
|
|
66
|
+
'Content-Type': 'application/json',
|
|
67
|
+
},
|
|
68
|
+
body: JSON.stringify({
|
|
69
|
+
variables: {
|
|
70
|
+
id: 'abc-123',
|
|
71
|
+
},
|
|
72
|
+
query: 'query UserName($id: String!) { user(id: $id) { name } }',
|
|
73
|
+
}),
|
|
74
|
+
}),
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
expect(console.warn).toHaveBeenCalledWith(fixtures.warningWithResponseBody())
|
|
78
|
+
})
|
|
79
|
+
|
|
80
|
+
test('supports the "error" request strategy', async () => {
|
|
81
|
+
await expect(
|
|
82
|
+
onUnhandledRequest(new Request(new URL('http://localhost/api')), 'error'),
|
|
83
|
+
).rejects.toThrow(
|
|
84
|
+
'[MSW] Cannot bypass a request when using the "error" strategy for the "onUnhandledRequest" option.',
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
expect(console.error).toHaveBeenCalledWith(fixtures.errorWithoutSuggestions)
|
|
88
|
+
})
|
|
89
|
+
|
|
90
|
+
test('supports a custom callback function', async () => {
|
|
91
|
+
const callback = vi.fn<UnhandledRequestCallback>((request) => {
|
|
92
|
+
console.warn(`callback: ${request.method} ${request.url}`)
|
|
93
|
+
})
|
|
94
|
+
const request = new Request(new URL('/user', 'http://localhost:3000'))
|
|
95
|
+
await onUnhandledRequest(request, callback)
|
|
96
|
+
|
|
97
|
+
expect(callback).toHaveBeenCalledTimes(1)
|
|
98
|
+
expect(callback).toHaveBeenCalledWith(request, {
|
|
99
|
+
warning: expect.any(Function),
|
|
100
|
+
error: expect.any(Function),
|
|
101
|
+
})
|
|
102
|
+
|
|
103
|
+
// Check that the custom logic in the callback was called.
|
|
104
|
+
expect(console.warn).toHaveBeenCalledWith(
|
|
105
|
+
`callback: GET http://localhost:3000/user`,
|
|
106
|
+
)
|
|
107
|
+
})
|
|
108
|
+
|
|
109
|
+
test('supports calling default strategies from the custom callback function', async () => {
|
|
110
|
+
const callback = vi.fn<UnhandledRequestCallback>((request, print) => {
|
|
111
|
+
// Call the default "error" strategy.
|
|
112
|
+
print.error()
|
|
113
|
+
})
|
|
114
|
+
const request = new Request(new URL('http://localhost/api'))
|
|
115
|
+
await expect(onUnhandledRequest(request, callback)).rejects.toThrow(
|
|
116
|
+
`[MSW] Cannot bypass a request when using the "error" strategy for the "onUnhandledRequest" option.`,
|
|
117
|
+
)
|
|
118
|
+
|
|
119
|
+
expect(callback).toHaveBeenCalledTimes(1)
|
|
120
|
+
expect(callback).toHaveBeenCalledWith(request, {
|
|
121
|
+
warning: expect.any(Function),
|
|
122
|
+
error: expect.any(Function),
|
|
123
|
+
})
|
|
124
|
+
|
|
125
|
+
// Check that the default strategy was called.
|
|
126
|
+
expect(console.error).toHaveBeenCalledWith(fixtures.errorWithoutSuggestions)
|
|
127
|
+
})
|
|
128
|
+
|
|
129
|
+
test('does not print any suggestions given no handlers to suggest', async () => {
|
|
130
|
+
await onUnhandledRequest(new Request(new URL('http://localhost/api')), 'warn')
|
|
131
|
+
|
|
132
|
+
expect(console.warn).toHaveBeenCalledWith(
|
|
133
|
+
fixtures.warningWithoutSuggestions(),
|
|
134
|
+
)
|
|
135
|
+
})
|
|
136
|
+
|
|
137
|
+
test('throws an exception given unknown request strategy', async () => {
|
|
138
|
+
await expect(
|
|
139
|
+
onUnhandledRequest(
|
|
140
|
+
new Request(new URL('http://localhost/api')),
|
|
141
|
+
// @ts-expect-error Intentional unknown strategy.
|
|
142
|
+
'invalid-strategy',
|
|
143
|
+
),
|
|
144
|
+
).rejects.toThrow(
|
|
145
|
+
'[MSW] Failed to react to an unhandled request: unknown strategy "invalid-strategy". Please provide one of the supported strategies ("bypass", "warn", "error") or a custom callback function as the value of the "onUnhandledRequest" option.',
|
|
146
|
+
)
|
|
147
|
+
})
|
|
148
|
+
|
|
149
|
+
test('prints with a relative URL and search params', async () => {
|
|
150
|
+
await onUnhandledRequest(
|
|
151
|
+
new Request(new URL('http://localhost/api?foo=boo')),
|
|
152
|
+
'warn',
|
|
153
|
+
)
|
|
154
|
+
|
|
155
|
+
expect(console.warn).toHaveBeenCalledWith(
|
|
156
|
+
fixtures.warningWithoutSuggestions(`/api?foo=boo`),
|
|
157
|
+
)
|
|
158
|
+
})
|
|
159
|
+
|
|
160
|
+
test('prints with an absolute URL and search params', async () => {
|
|
161
|
+
await onUnhandledRequest(
|
|
162
|
+
new Request(new URL('https://mswjs.io/api?foo=boo')),
|
|
163
|
+
'warn',
|
|
164
|
+
)
|
|
165
|
+
|
|
166
|
+
expect(console.warn).toHaveBeenCalledWith(
|
|
167
|
+
fixtures.warningWithoutSuggestions(`https://mswjs.io/api?foo=boo`),
|
|
168
|
+
)
|
|
169
|
+
})
|
|
170
|
+
|
|
171
|
+
test('ignores common static assets when using the "warn" strategy', async () => {
|
|
172
|
+
await Promise.allSettled([
|
|
173
|
+
onUnhandledRequest(
|
|
174
|
+
new Request(new URL('https://example.com/main.css')),
|
|
175
|
+
'warn',
|
|
176
|
+
),
|
|
177
|
+
onUnhandledRequest(
|
|
178
|
+
new Request(new URL('https://example.com/index.mjs')),
|
|
179
|
+
'warn',
|
|
180
|
+
),
|
|
181
|
+
onUnhandledRequest(
|
|
182
|
+
new Request(new URL('https://example.com/node_modules/abc-123')),
|
|
183
|
+
'warn',
|
|
184
|
+
),
|
|
185
|
+
onUnhandledRequest(
|
|
186
|
+
new Request(new URL('https://fonts.googleapis.com/some-font')),
|
|
187
|
+
'warn',
|
|
188
|
+
),
|
|
189
|
+
])
|
|
190
|
+
|
|
191
|
+
expect(console.warn).not.toHaveBeenCalled()
|
|
192
|
+
})
|
|
193
|
+
|
|
194
|
+
test('ignores common static assets when using the "error" strategy', async () => {
|
|
195
|
+
await Promise.allSettled([
|
|
196
|
+
onUnhandledRequest(
|
|
197
|
+
new Request(new URL('https://example.com/main.css')),
|
|
198
|
+
'error',
|
|
199
|
+
),
|
|
200
|
+
onUnhandledRequest(
|
|
201
|
+
new Request(new URL('https://example.com/index.mjs')),
|
|
202
|
+
'error',
|
|
203
|
+
),
|
|
204
|
+
onUnhandledRequest(
|
|
205
|
+
new Request(new URL('https://example.com/node_modules/abc-123')),
|
|
206
|
+
'error',
|
|
207
|
+
),
|
|
208
|
+
onUnhandledRequest(
|
|
209
|
+
new Request(new URL('https://fonts.googleapis.com/some-font')),
|
|
210
|
+
'error',
|
|
211
|
+
),
|
|
212
|
+
])
|
|
213
|
+
|
|
214
|
+
expect(console.error).not.toHaveBeenCalled()
|
|
215
|
+
})
|
|
216
|
+
|
|
217
|
+
test('exposes common static assets to the explicit callback', async () => {
|
|
218
|
+
let callbackRequest!: Request
|
|
219
|
+
await onUnhandledRequest(
|
|
220
|
+
new Request(new URL('https://example.com/main.css')),
|
|
221
|
+
(request) => {
|
|
222
|
+
callbackRequest = request
|
|
223
|
+
},
|
|
224
|
+
)
|
|
225
|
+
|
|
226
|
+
expect(callbackRequest).toBeInstanceOf(Request)
|
|
227
|
+
expect(callbackRequest.url).toBe('https://example.com/main.css')
|
|
228
|
+
})
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { toPublicUrl } from './toPublicUrl'
|
|
2
|
+
import { InternalError, devUtils } from '../internal/devUtils'
|
|
3
|
+
import { isCommonAssetRequest } from '../../isCommonAssetRequest'
|
|
4
|
+
|
|
5
|
+
export interface UnhandledRequestPrint {
|
|
6
|
+
warning(): void
|
|
7
|
+
error(): void
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export type UnhandledRequestCallback = (
|
|
11
|
+
request: Request,
|
|
12
|
+
print: UnhandledRequestPrint,
|
|
13
|
+
) => void
|
|
14
|
+
|
|
15
|
+
export type UnhandledRequestStrategy =
|
|
16
|
+
| 'bypass'
|
|
17
|
+
| 'warn'
|
|
18
|
+
| 'error'
|
|
19
|
+
| UnhandledRequestCallback
|
|
20
|
+
|
|
21
|
+
export async function onUnhandledRequest(
|
|
22
|
+
request: Request,
|
|
23
|
+
strategy: UnhandledRequestStrategy = 'warn',
|
|
24
|
+
): Promise<void> {
|
|
25
|
+
const url = new URL(request.url)
|
|
26
|
+
const publicUrl = toPublicUrl(url) + url.search
|
|
27
|
+
|
|
28
|
+
const requestBody =
|
|
29
|
+
request.method === 'HEAD' || request.method === 'GET'
|
|
30
|
+
? null
|
|
31
|
+
: await request.clone().text()
|
|
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/http/intercepting-requests`
|
|
34
|
+
|
|
35
|
+
function applyStrategy(strategy: UnhandledRequestStrategy) {
|
|
36
|
+
switch (strategy) {
|
|
37
|
+
case 'error': {
|
|
38
|
+
// Print a developer-friendly error.
|
|
39
|
+
devUtils.error('Error: %s', unhandledRequestMessage)
|
|
40
|
+
|
|
41
|
+
// Throw an exception to halt request processing and not perform the original request.
|
|
42
|
+
throw new InternalError(
|
|
43
|
+
devUtils.formatMessage(
|
|
44
|
+
'Cannot bypass a request when using the "error" strategy for the "onUnhandledRequest" option.',
|
|
45
|
+
),
|
|
46
|
+
)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
case 'warn': {
|
|
50
|
+
devUtils.warn('Warning: %s', unhandledRequestMessage)
|
|
51
|
+
break
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
case 'bypass':
|
|
55
|
+
break
|
|
56
|
+
|
|
57
|
+
default:
|
|
58
|
+
throw new InternalError(
|
|
59
|
+
devUtils.formatMessage(
|
|
60
|
+
'Failed to react to an unhandled request: unknown strategy "%s". Please provide one of the supported strategies ("bypass", "warn", "error") or a custom callback function as the value of the "onUnhandledRequest" option.',
|
|
61
|
+
strategy,
|
|
62
|
+
),
|
|
63
|
+
)
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (typeof strategy === 'function') {
|
|
68
|
+
strategy(request, {
|
|
69
|
+
warning: applyStrategy.bind(null, 'warn'),
|
|
70
|
+
error: applyStrategy.bind(null, 'error'),
|
|
71
|
+
})
|
|
72
|
+
return
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Ignore common static asset requests when using a built-in strategy.
|
|
76
|
+
// There's a slight overhead here because this utility will create a request URL
|
|
77
|
+
// instance again despite us having done so previously in this function.
|
|
78
|
+
if (!isCommonAssetRequest(request)) {
|
|
79
|
+
applyStrategy(strategy)
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { cookieStore } from '../cookieStore'
|
|
2
|
+
import { kSetCookie } from '../HttpResponse/decorators'
|
|
3
|
+
|
|
4
|
+
export async function storeResponseCookies(
|
|
5
|
+
request: Request,
|
|
6
|
+
response: Response,
|
|
7
|
+
): Promise<void> {
|
|
8
|
+
// Grab the raw "Set-Cookie" response header provided
|
|
9
|
+
// in the HeadersInit for this mocked response.
|
|
10
|
+
const responseCookies = Reflect.get(response, kSetCookie) as
|
|
11
|
+
| string
|
|
12
|
+
| undefined
|
|
13
|
+
|
|
14
|
+
if (responseCookies) {
|
|
15
|
+
await cookieStore.setCookie(responseCookies, request.url)
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// @vitest-environment node
|
|
2
|
+
import { toPublicUrl } from './toPublicUrl'
|
|
3
|
+
|
|
4
|
+
test('returns an absolute request URL without search params', () => {
|
|
5
|
+
expect(toPublicUrl(new URL('https://test.mswjs.io/path'))).toBe(
|
|
6
|
+
'https://test.mswjs.io/path',
|
|
7
|
+
)
|
|
8
|
+
|
|
9
|
+
expect(toPublicUrl(new URL('http://192.168.0.10/path'))).toBe(
|
|
10
|
+
'http://192.168.0.10/path',
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
expect(
|
|
14
|
+
toPublicUrl(new URL('http://localhost/path?foo=bar')),
|
|
15
|
+
'Must not return relative URL in Node.js',
|
|
16
|
+
).toBe('http://localhost/path')
|
|
17
|
+
})
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// @vitest-environment jsdom
|
|
2
|
+
import { toPublicUrl } from './toPublicUrl'
|
|
3
|
+
|
|
4
|
+
test('returns an absolute request URL without search params', () => {
|
|
5
|
+
expect(toPublicUrl(new URL('https://test.mswjs.io/path'))).toBe(
|
|
6
|
+
'https://test.mswjs.io/path',
|
|
7
|
+
)
|
|
8
|
+
|
|
9
|
+
expect(toPublicUrl(new URL('http://localhost/path'))).toBe('/path')
|
|
10
|
+
|
|
11
|
+
expect(toPublicUrl(new URL('http://localhost/path?foo=bar'))).toBe('/path')
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
it('returns a relative URL given the request to the same origin', () => {
|
|
15
|
+
expect(toPublicUrl('http://localhost/user')).toBe('/user')
|
|
16
|
+
})
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns a relative URL if the given request URL is relative
|
|
3
|
+
* to the current origin. Otherwise returns an absolute URL.
|
|
4
|
+
*/
|
|
5
|
+
export function toPublicUrl(url: string | URL): string {
|
|
6
|
+
const urlInstance = url instanceof URL ? url : new URL(url)
|
|
7
|
+
|
|
8
|
+
if (
|
|
9
|
+
typeof location !== 'undefined' &&
|
|
10
|
+
urlInstance.origin === location.origin
|
|
11
|
+
) {
|
|
12
|
+
return urlInstance.pathname
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
return urlInstance.origin + urlInstance.pathname
|
|
16
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { cleanUrl } from './cleanUrl'
|
|
2
|
+
|
|
3
|
+
it('removes query parameters from a URL string', () => {
|
|
4
|
+
expect(cleanUrl('/user?id=123')).toEqual('/user')
|
|
5
|
+
expect(cleanUrl('/user?id=123&id=456')).toEqual('/user')
|
|
6
|
+
expect(cleanUrl('/user?id=123&role=admin')).toEqual('/user')
|
|
7
|
+
})
|
|
8
|
+
|
|
9
|
+
it('removes hashes from a URL string', () => {
|
|
10
|
+
expect(cleanUrl('/user#hash')).toEqual('/user')
|
|
11
|
+
expect(cleanUrl('/user#hash-with-dashes')).toEqual('/user')
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
it('removes both query parameters and hashes from a URL string', () => {
|
|
15
|
+
expect(cleanUrl('/user?id=123#some')).toEqual('/user')
|
|
16
|
+
expect(cleanUrl('/user?id=123&role=admin#some')).toEqual('/user')
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
it('preserves optional path parameters', () => {
|
|
20
|
+
expect(cleanUrl('/user/:id?')).toEqual('/user/:id?')
|
|
21
|
+
expect(cleanUrl('/user/:id?/:messageId?')).toEqual('/user/:id?/:messageId?')
|
|
22
|
+
})
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const REDUNDANT_CHARACTERS_EXP = /[?|#].*$/g
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Removes search parameters and the fragment
|
|
5
|
+
* from a given URL string.
|
|
6
|
+
*/
|
|
7
|
+
export function cleanUrl(path: string): string {
|
|
8
|
+
// If the path ends with an optional path parameter,
|
|
9
|
+
// return it as-is.
|
|
10
|
+
if (path.endsWith('?')) {
|
|
11
|
+
return path
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// Otherwise, remove the search and fragment from it.
|
|
15
|
+
return path.replace(REDUNDANT_CHARACTERS_EXP, '')
|
|
16
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @vitest-environment node
|
|
3
|
+
*/
|
|
4
|
+
import { getAbsoluteUrl } from './getAbsoluteUrl'
|
|
5
|
+
|
|
6
|
+
it('returns a given relative URL as-is', () => {
|
|
7
|
+
expect(getAbsoluteUrl('/reviews')).toBe('/reviews')
|
|
8
|
+
})
|
|
9
|
+
|
|
10
|
+
it('rebases a relative URL against a custom base URL', () => {
|
|
11
|
+
expect(getAbsoluteUrl('/user', 'https://api.github.com')).toEqual(
|
|
12
|
+
'https://api.github.com/user',
|
|
13
|
+
)
|
|
14
|
+
})
|
|
15
|
+
it('returns a given absolute URL as-is', () => {
|
|
16
|
+
expect(getAbsoluteUrl('https://api.mswjs.io/users')).toBe(
|
|
17
|
+
'https://api.mswjs.io/users',
|
|
18
|
+
)
|
|
19
|
+
})
|