Unverified Commit 3c0fd70f authored by Sebastian "Sebbie" Silbermann's avatar Sebastian "Sebbie" Silbermann Committed by GitHub

Consistently gate navigation-testing-lock API on flag (#95582)

parent da06078b
...@@ -138,7 +138,10 @@ export type NavigationLockState = { ...@@ -138,7 +138,10 @@ export type NavigationLockState = {
let lockState: NavigationLockState | null = null let lockState: NavigationLockState | null = null
export function getPreLockFetch(): typeof fetch | null { export function getPreLockFetch(): typeof fetch | null {
return lockState !== null ? lockState.fetch : null if (process.env.__NEXT_EXPOSE_TESTING_API && lockState !== null) {
return lockState.fetch
}
return null
} }
/** /**
...@@ -297,7 +300,7 @@ function releaseLock(): void { ...@@ -297,7 +300,7 @@ function releaseLock(): void {
* NOTE: This override only affects environments where the Instant Navigation * NOTE: This override only affects environments where the Instant Navigation
* Testing API is enabled. It has no impact on live production behavior. * Testing API is enabled. It has no impact on live production behavior.
*/ */
export function globalFetchOverride( function globalFetchOverride(
input: RequestInfo | URL, input: RequestInfo | URL,
init?: RequestInit init?: RequestInit
): Promise<Response> { ): Promise<Response> {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment