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
d7db7440
Unverified
Commit
d7db7440
authored
Feb 26, 2026
by
Sebastian "Sebbie" Silbermann
Committed by
GitHub
Feb 26, 2026
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[test] Deflake `typed-routes-validator` (#90562)
parent
cd6a9bc7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
20 deletions
+21
-20
typed-routes-validator.test.ts
...dir/typed-routes-validator/typed-routes-validator.test.ts
+21
-20
No files found.
test/e2e/app-dir/typed-routes-validator/typed-routes-validator.test.ts
View file @
d7db7440
...
@@ -43,29 +43,30 @@ describe('typed-routes-validator', () => {
...
@@ -43,29 +43,30 @@ describe('typed-routes-validator', () => {
}
}
try
{
try
{
if
(
isNextDev
)
{
if
(
isNextDev
)
{
// In dev mode, next-env.d.ts and the route type definitions it
// In dev mode, route types are generated asynchronously after the server starts.
// references (.next/types/routes.d.ts) are generated asynchronously
// Might take a few tries before all the relevant types exist.
// after the server starts. Wait for both files to be ready with
// actual route data before running tsc.
await
retry
(
async
()
=>
{
await
retry
(
async
()
=>
{
const
envDts
=
await
next
.
readFile
(
'next-env.d.ts'
)
const
{
stdout
,
stderr
}
=
await
execa
(
'pnpm'
,
[
'tsc'
,
'--noEmit'
],
{
expect
(
envDts
).
toContain
(
'reference types="next"'
)
cwd
:
next
.
testDir
,
const
routesDts
=
await
next
.
readFile
(
reject
:
false
,
`
${
getDistDir
()}
/types/routes.d.ts`
})
)
expect
(
routesDts
).
toContain
(
'AppRoutes = "/"'
)
expect
({
stdout
,
stderr
}).
toEqual
({
stdout
:
''
,
stderr
:
''
,
})
})
}
else
{
const
{
stdout
,
stderr
}
=
await
execa
(
'pnpm'
,
[
'tsc'
,
'--noEmit'
],
{
cwd
:
next
.
testDir
,
reject
:
false
,
})
})
}
const
{
stdout
,
stderr
}
=
await
execa
(
'pnpm'
,
[
'tsc'
,
'--noEmit'
],
{
cwd
:
next
.
testDir
,
reject
:
false
,
})
expect
({
stdout
,
stderr
}).
toEqual
({
expect
({
stdout
,
stderr
}).
toEqual
({
stdout
:
''
,
stdout
:
''
,
stderr
:
''
,
stderr
:
''
,
})
})
}
}
finally
{
}
finally
{
if
(
isNextDev
)
{
if
(
isNextDev
)
{
await
next
.
stop
()
await
next
.
stop
()
...
...
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