Repository: mswjs/msw
Pull request #2519 (2025-05-31 11:12:43)

fix: update links to the documentation
- Follow up to https://github.com/mswjs/mswjs.io/pull/462


Patch:
diff --git a/README.md b/README.md
index 826e4ca9..ea4a6ad6 100644
--- a/README.md
+++ b/README.md
@@ -31,7 +31,7 @@
 This README will give you a brief overview of the library, but there's no better place to start with Mock Service Worker than its official documentation.
 
 - [Documentation](https://mswjs.io/docs)
-- [**Getting started**](https://mswjs.io/docs/getting-started)
+- [**Quick start**](https://mswjs.io/docs/quick-start)
 - [FAQ](https://mswjs.io/docs/faq)
 
 ## Examples
diff --git a/cli/init.js b/cli/init.js
index f45d7141..4ef591fa 100755
--- a/cli/init.js
+++ b/cli/init.js
@@ -149,7 +149,7 @@ ${paths.map((path) => colors.gray(`  - ${path}\n`))}
 Continue by describing the network in your application:
 
 
-${colors.red(colors.bold('https://mswjs.io/docs/getting-started'))}
+${colors.red(colors.bold('https://mswjs.io/docs/quick-start'))}
 `)
 }
 
diff --git a/src/browser/setupWorker/start/createRequestListener.ts b/src/browser/setupWorker/start/createRequestListener.ts
index ec96603a..c43974c1 100644
--- a/src/browser/setupWorker/start/createRequestListener.ts
+++ b/src/browser/setupWorker/start/createRequestListener.ts
@@ -111,7 +111,7 @@ export const createRequestListener = (
 
 %s
 
-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/recipes/mocking-error-responses`,
+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`,
           request.method,
           request.url,
           error.stack ?? error,
diff --git a/src/core/handlers/HttpHandler.ts b/src/core/handlers/HttpHandler.ts
index 6f75e22c..bf17cb83 100644
--- a/src/core/handlers/HttpHandler.ts
+++ b/src/core/handlers/HttpHandler.ts
@@ -102,7 +102,7 @@ export class HttpHandler extends RequestHandler<
     })
 
     devUtils.warn(
-      `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/recipes/query-parameters`,
+      `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`,
     )
   }
 
diff --git a/src/core/utils/request/onUnhandledRequest.ts b/src/core/utils/request/onUnhandledRequest.ts
index 2434a4d5..3e1ff708 100644
--- a/src/core/utils/request/onUnhandledRequest.ts
+++ b/src/core/utils/request/onUnhandledRequest.ts
@@ -30,7 +30,7 @@ export async function onUnhandledRequest(
       ? null
       : await request.clone().text()
   const messageDetails = `\n\n  \u2022 ${request.method} ${publicUrl}\n\n${requestBody ? `  \u2022 Request body: ${requestBody}\n\n` : ''}`
-  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/getting-started/mocks`
+  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`
 
   function applyStrategy(strategy: UnhandledRequestStrategy) {
     switch (strategy) {


Test patch:
diff --git a/src/core/utils/request/onUnhandledRequest.test.ts b/src/core/utils/request/onUnhandledRequest.test.ts
index 5c14628a..d69e47e3 100644
--- a/src/core/utils/request/onUnhandledRequest.test.ts
+++ b/src/core/utils/request/onUnhandledRequest.test.ts
@@ -11,7 +11,7 @@ const fixtures = {
   • GET ${url}
 
 If you still wish to intercept this unhandled request, please create a request handler for it.
-Read more: https://mswjs.io/docs/getting-started/mocks`,
+Read more: https://mswjs.io/docs/http/intercepting-requests`,
   warningWithResponseBody: (url = `/api`) => `\
 [MSW] Warning: intercepted a request without a matching request handler:
 
@@ -20,7 +20,7 @@ Read more: https://mswjs.io/docs/getting-started/mocks`,
   • Request body: {\"variables\":{\"id\":\"abc-123\"},\"query\":\"query UserName($id: String!) { user(id: $id) { name } }\"}
 
 If you still wish to intercept this unhandled request, please create a request handler for it.
-Read more: https://mswjs.io/docs/getting-started/mocks`,
+Read more: https://mswjs.io/docs/http/intercepting-requests`,
 
   errorWithoutSuggestions: `\
 [MSW] Error: intercepted a request without a matching request handler:
@@ -28,7 +28,7 @@ Read more: https://mswjs.io/docs/getting-started/mocks`,
   • GET /api
 
 If you still wish to intercept this unhandled request, please create a request handler for it.
-Read more: https://mswjs.io/docs/getting-started/mocks`,
+Read more: https://mswjs.io/docs/http/intercepting-requests`,
 }
 
 beforeEach(() => {
diff --git a/test/browser/graphql-api/anonymous-operation.test.ts b/test/browser/graphql-api/anonymous-operation.test.ts
index 437ebe6d..cb821ec9 100644
--- a/test/browser/graphql-api/anonymous-operation.test.ts
+++ b/test/browser/graphql-api/anonymous-operation.test.ts
@@ -74,7 +74,7 @@ test('does not warn on anonymous GraphQL operation when no GraphQL handlers are
   • Request body: {\"query\":\"\\n      query {\\n        user {\\n          id\\n        }\\n      }\\n    \"}
 
 If you still wish to intercept this unhandled request, please create a request handler for it.
-Read more: https://mswjs.io/docs/getting-started/mocks`,
+Read more: https://mswjs.io/docs/http/intercepting-requests`,
     ])
   })
 })
diff --git a/test/browser/msw-api/setup-worker/fallback-mode/fallback-mode.test.ts b/test/browser/msw-api/setup-worker/fallback-mode/fallback-mode.test.ts
index 2bd88a03..d0423762 100644
--- a/test/browser/msw-api/setup-worker/fallback-mode/fallback-mode.test.ts
+++ b/test/browser/msw-api/setup-worker/fallback-mode/fallback-mode.test.ts
@@ -149,7 +149,7 @@ test('warns on the unhandled request by default', async ({
   • GET ${server.http.url('/unknown-resource')}
 
 If you still wish to intercept this unhandled request, please create a request handler for it.
-Read more: https://mswjs.io/docs/getting-started/mocks`),
+Read more: https://mswjs.io/docs/http/intercepting-requests`),
     ]),
   )
 })
diff --git a/test/browser/msw-api/setup-worker/start/on-unhandled-request/callback-print.test.ts b/test/browser/msw-api/setup-worker/start/on-unhandled-request/callback-print.test.ts
index af7a7869..d7a88412 100644
--- a/test/browser/msw-api/setup-worker/start/on-unhandled-request/callback-print.test.ts
+++ b/test/browser/msw-api/setup-worker/start/on-unhandled-request/callback-print.test.ts
@@ -29,7 +29,7 @@ test('executes a default "warn" strategy in a custom callback', async ({
   • GET https://mswjs.io/use-warn
 
 If you still wish to intercept this unhandled request, please create a request handler for it.
-Read more: https://mswjs.io/docs/getting-started/mocks`),
+Read more: https://mswjs.io/docs/http/intercepting-requests`),
     ]),
   )
 })
@@ -63,7 +63,7 @@ test('executes a default "error" strategy in a custom callback', async ({
   • GET https://mswjs.io/use-error
 
 If you still wish to intercept this unhandled request, please create a request handler for it.
-Read more: https://mswjs.io/docs/getting-started/mocks`),
+Read more: https://mswjs.io/docs/http/intercepting-requests`),
     ]),
   )
 })
diff --git a/test/browser/msw-api/setup-worker/start/on-unhandled-request/warn.test.ts b/test/browser/msw-api/setup-worker/start/on-unhandled-request/warn.test.ts
index 44b1302e..aff193e9 100644
--- a/test/browser/msw-api/setup-worker/start/on-unhandled-request/warn.test.ts
+++ b/test/browser/msw-api/setup-worker/start/on-unhandled-request/warn.test.ts
@@ -20,7 +20,7 @@ test('warns on an unhandled REST API request with an absolute URL', async ({
   • GET https://mswjs.io/non-existing-page
 
 If you still wish to intercept this unhandled request, please create a request handler for it.
-Read more: https://mswjs.io/docs/getting-started/mocks`),
+Read more: https://mswjs.io/docs/http/intercepting-requests`),
     ]),
   )
 })
@@ -45,7 +45,7 @@ test('warns on an unhandled REST API request with a relative URL', async ({
   • GET /user-details
 
 If you still wish to intercept this unhandled request, please create a request handler for it.
-Read more: https://mswjs.io/docs/getting-started/mocks`),
+Read more: https://mswjs.io/docs/http/intercepting-requests`),
     ]),
   )
 })
diff --git a/test/browser/rest-api/query-params-warning.test.ts b/test/browser/rest-api/query-params-warning.test.ts
index 191d3ff3..ab28ac2a 100644
--- a/test/browser/rest-api/query-params-warning.test.ts
+++ b/test/browser/rest-api/query-params-warning.test.ts
@@ -9,8 +9,8 @@ test('warns when a request handler URL contains query parameters', async ({
   await loadExample(new URL('./query-params-warning.mocks.ts', import.meta.url))
 
   expect(consoleSpy.get('warning')).toEqual([
-    `[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/recipes/query-parameters`,
-    `[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/recipes/query-parameters`,
+    `[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`,
+    `[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`,
   ])
 
   await fetch('/user?name=admin').then(async (res) => {
diff --git a/test/node/msw-api/setup-server/scenarios/on-unhandled-request/default.node.test.ts b/test/node/msw-api/setup-server/scenarios/on-unhandled-request/default.node.test.ts
index 30e4f0a5..03118441 100644
--- a/test/node/msw-api/setup-server/scenarios/on-unhandled-request/default.node.test.ts
+++ b/test/node/msw-api/setup-server/scenarios/on-unhandled-request/default.node.test.ts
@@ -38,7 +38,7 @@ it('warns on unhandled requests by default', async () => {
   • GET https://test.mswjs.io/
 
 If you still wish to intercept this unhandled request, please create a request handler for it.
-Read more: https://mswjs.io/docs/getting-started/mocks`)
+Read more: https://mswjs.io/docs/http/intercepting-requests`)
 })
 
 it('does not warn on unhandled "file://" requests', async () => {
diff --git a/test/node/msw-api/setup-server/scenarios/on-unhandled-request/error.node.test.ts b/test/node/msw-api/setup-server/scenarios/on-unhandled-request/error.node.test.ts
index 3cad6200..135d641a 100644
--- a/test/node/msw-api/setup-server/scenarios/on-unhandled-request/error.node.test.ts
+++ b/test/node/msw-api/setup-server/scenarios/on-unhandled-request/error.node.test.ts
@@ -81,7 +81,7 @@ test('errors on unhandled request when using the "error" strategy', async () =>
   • GET ${endpointUrl}
 
 If you still wish to intercept this unhandled request, please create a request handler for it.
-Read more: https://mswjs.io/docs/getting-started/mocks`)
+Read more: https://mswjs.io/docs/http/intercepting-requests`)
   expect(console.warn).not.toHaveBeenCalled()
 })
 
diff --git a/test/node/msw-api/setup-server/scenarios/on-unhandled-request/warn.node.test.ts b/test/node/msw-api/setup-server/scenarios/on-unhandled-request/warn.node.test.ts
index f2000a4a..ad8c914b 100644
--- a/test/node/msw-api/setup-server/scenarios/on-unhandled-request/warn.node.test.ts
+++ b/test/node/msw-api/setup-server/scenarios/on-unhandled-request/warn.node.test.ts
@@ -26,7 +26,7 @@ test('warns on unhandled request when using the "warn" strategy', async () => {
   • GET https://test.mswjs.io/user
 
 If you still wish to intercept this unhandled request, please create a request handler for it.
-Read more: https://mswjs.io/docs/getting-started/mocks`)
+Read more: https://mswjs.io/docs/http/intercepting-requests`)
 })
 
 test(
diff --git a/test/node/ws-api/on-unhandled-request/error.test.ts b/test/node/ws-api/on-unhandled-request/error.test.ts
index 8706b122..9c4837d2 100644
--- a/test/node/ws-api/on-unhandled-request/error.test.ts
+++ b/test/node/ws-api/on-unhandled-request/error.test.ts
@@ -44,7 +44,7 @@ it(
   • GET wss://localhost:4321/
 
 If you still wish to intercept this unhandled request, please create a request handler for it.
-Read more: https://mswjs.io/docs/getting-started/mocks`,
+Read more: https://mswjs.io/docs/http/intercepting-requests`,
     )
 
     expect(errorListener).toHaveBeenCalledOnce()
diff --git a/test/node/ws-api/on-unhandled-request/warn.test.ts b/test/node/ws-api/on-unhandled-request/warn.test.ts
index 5473692a..401b66d3 100644
--- a/test/node/ws-api/on-unhandled-request/warn.test.ts
+++ b/test/node/ws-api/on-unhandled-request/warn.test.ts
@@ -39,7 +39,7 @@ it(
   • GET wss://localhost:4321/
 
 If you still wish to intercept this unhandled request, please create a request handler for it.
-Read more: https://mswjs.io/docs/getting-started/mocks`,
+Read more: https://mswjs.io/docs/http/intercepting-requests`,
     )
   }),
 )