File tree 1 file changed +4
-4
lines changed
packages/next/src/experimental/testmode/playwright
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -50,11 +50,11 @@ export default defineConfig({
50
50
import { test , expect } from ' next/experimental/testmode/playwright'
51
51
52
52
test (' /product/shoe' , async ({ page, next }) => {
53
+ // NOTE: `next.onFetch` only intercepts external `fetch` requests (for both client and server).
54
+ // For example, if you `fetch` a relative URL (e.g. `/api/hello`) from the client
55
+ // that's handled by a Next.js route handler (e.g. `app/api/hello/route.ts`),
56
+ // it won't be intercepted.
53
57
next .onFetch ((request ) => {
54
- // `next.onFetch` only intercepts external fetch requests (for both client and server).
55
- // For example, if you `fetch` a relative URL (e.g. `/api/hello`) from the client
56
- // that's handled by a Next.js route handler (e.g. `app/api/hello/route.ts`),
57
- // it won't be intercepted.
58
58
if (request .url === ' http://my-db/product/shoe' ) {
59
59
return new Response (
60
60
JSON .stringify ({
You can’t perform that action at this time.
0 commit comments