Skip to content

Commit

Permalink
Skip the internal Next requests
Browse files Browse the repository at this point in the history
  • Loading branch information
dvoytenko committed Aug 8, 2023
1 parent 8e68173 commit de0332a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/next/src/experimental/testmode/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,15 @@ export function createTestFetch(originalFetch: Fetch): Fetch {
input: FetchInputArg,
init?: FetchInitArg
): Promise<Response> {
// Passthrough internal requests.
// @ts-ignore
if (init?.next?.internal) {
return originalFetch(input, init)
}

const testInfo = testStorage.getStore()
if (!testInfo) {
return Promise.reject(new Error('No test info'))
throw new Error('No test info')
}

const { testData, proxyPort } = testInfo
Expand Down

0 comments on commit de0332a

Please sign in to comment.