Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
4abd51e4
Commit
4abd51e4
authored
Apr 11, 2026
by
Jimmy Lai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix fetch server response test types
parent
84801c43
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
fetch-server-response.test.ts
...t/components/router-reducer/fetch-server-response.test.ts
+9
-8
No files found.
packages/next/src/client/components/router-reducer/fetch-server-response.test.ts
View file @
4abd51e4
...
...
@@ -34,11 +34,12 @@ describe('fetchServerResponse output export fallback', () => {
const
originalOutput
=
process
.
env
.
__NEXT_CONFIG_OUTPUT
const
originalFetch
=
global
.
fetch
const
originalLocation
=
global
.
location
const
processEnv
=
process
.
env
as
Record
<
string
,
string
|
undefined
>
beforeEach
(()
=>
{
process
.
e
nv
.
NODE_ENV
=
'production'
process
.
e
nv
.
__NEXT_CONFIG_OUTPUT
=
'export'
global
.
location
=
new
URL
(
'https://example.com/'
)
as
Location
process
E
nv
.
NODE_ENV
=
'production'
process
E
nv
.
__NEXT_CONFIG_OUTPUT
=
'export'
global
.
location
=
new
URL
(
'https://example.com/'
)
as
unknown
as
Location
setNavigationBuildId
(
'build-id'
)
mockCreateFromReadableStream
.
mockReset
()
mockFetchOutputExportFallbackResponse
.
mockReset
()
...
...
@@ -47,8 +48,8 @@ describe('fetchServerResponse output export fallback', () => {
})
afterEach
(()
=>
{
process
.
e
nv
.
NODE_ENV
=
originalNodeEnv
process
.
e
nv
.
__NEXT_CONFIG_OUTPUT
=
originalOutput
process
E
nv
.
NODE_ENV
=
originalNodeEnv
process
E
nv
.
__NEXT_CONFIG_OUTPUT
=
originalOutput
global
.
fetch
=
originalFetch
global
.
location
=
originalLocation
jest
.
restoreAllMocks
()
...
...
@@ -72,11 +73,11 @@ describe('fetchServerResponse output export fallback', () => {
)
global
.
fetch
=
jest
.
fn
<
typeof
fetch
>
(
)
.
mock
ResolvedValueOnce
(
initialMiss
)
.
fn
(
async
()
=>
initialMiss
)
.
mock
ImplementationOnce
(
async
()
=>
initialMiss
)
.
mockImplementation
(
async
()
=>
{
throw
new
Error
(
'unexpected extra fetch'
)
})
})
as
typeof
fetch
mockFetchOutputExportFallbackResponse
.
mockResolvedValue
({
response
:
fallbackResponse
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment