You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test('throws an exception given unknown request strategy',async()=>{
@@ -117,3 +121,25 @@ test('throws an exception given unknown request strategy', async () => {
117
121
'[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.',
118
122
)
119
123
})
124
+
125
+
test('prints with a relative URL and search params',async()=>{
Copy file name to clipboardexpand all lines: src/core/utils/request/onUnhandledRequest.ts
+1-1
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ export async function onUnhandledRequest(
22
22
strategy: UnhandledRequestStrategy='warn',
23
23
): Promise<void>{
24
24
consturl=newURL(request.url)
25
-
constpublicUrl=toPublicUrl(url)
25
+
constpublicUrl=toPublicUrl(url)+url.search
26
26
27
27
constunhandledRequestMessage=`intercepted a request without a matching request handler:\n\n \u2022 ${request.method}${publicUrl}\n\nIf you still wish to intercept this unhandled request, please create a request handler for it.\nRead more: https://mswjs.io/docs/getting-started/mocks`
0 commit comments