Skip to content

Commit 6cdce81

Browse files
authored
fix(HttpHandler): use correct query parameters docs link (#2547)
1 parent 594e91f commit 6cdce81

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/core/handlers/HttpHandler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export class HttpHandler extends RequestHandler<
102102
})
103103

104104
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/http/intercepting-requestsquery-parameters`,
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-requests#querysearch-parameters`,
106106
)
107107
}
108108

test/browser/rest-api/query-params-warning.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ test('warns when a request handler URL contains query parameters', async ({
99
await loadExample(new URL('./query-params-warning.mocks.ts', import.meta.url))
1010

1111
expect(consoleSpy.get('warning')).toEqual([
12-
`[MSW] Found a redundant usage of query parameters in the request handler URL for "GET /user?name=admin". 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`,
13-
`[MSW] Found a redundant usage of query parameters in the request handler URL for "POST /login?id=123&type=auth". 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`,
12+
`[MSW] Found a redundant usage of query parameters in the request handler URL for "GET /user?name=admin". 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-requests#querysearch-parameters`,
13+
`[MSW] Found a redundant usage of query parameters in the request handler URL for "POST /login?id=123&type=auth". 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-requests#querysearch-parameters`,
1414
])
1515

1616
await fetch('/user?name=admin').then(async (res) => {

0 commit comments

Comments
 (0)