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
e9386a6e
Commit
e9386a6e
authored
Jan 08, 2026
by
Tim Neutkens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update dev-output.test.ts
parent
7ba98115
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
27 deletions
+12
-27
dev-output.test.ts
test/development/app-dir/dev-output/dev-output.test.ts
+12
-27
No files found.
test/development/app-dir/dev-output/dev-output.test.ts
View file @
e9386a6e
import
{
nextTestSetup
}
from
'e2e-utils'
import
{
retry
}
from
'next-test-utils'
const
{
version
:
nextVersion
}
=
require
(
'next/package.json'
)
const
cacheComponentsEnabled
=
process
.
env
.
__NEXT_CACHE_COMPONENTS
===
'true'
...
...
@@ -10,44 +9,30 @@ describe('dev-output', () => {
})
it
(
'shows Cache Components indicator when enabled'
,
async
()
=>
{
await
next
.
fetch
(
'/'
)
await
retry
(
async
()
=>
{
const
preamble
=
getPreambleOutput
(
next
.
cliOutput
)
const
output
=
next
.
cliOutput
if
(
cacheComponentsEnabled
)
{
if
(
isTurbopack
)
{
expect
(
preamble
).
toContain
(
'Next.js'
)
expect
(
preamble
).
toContain
(
'Turbopack'
)
expect
(
preamble
).
toContain
(
'Cache Components'
)
expect
(
output
).
toContain
(
'Next.js'
)
expect
(
output
).
toContain
(
'Turbopack'
)
expect
(
output
).
toContain
(
'Cache Components'
)
}
else
{
expect
(
preamble
).
toContain
(
'Next.js'
)
expect
(
preamble
).
toContain
(
'webpack'
)
expect
(
preamble
).
toContain
(
'Cache Components'
)
expect
(
output
).
toContain
(
'Next.js'
)
expect
(
output
).
toContain
(
'webpack'
)
expect
(
output
).
toContain
(
'Cache Components'
)
}
}
else
{
// When cache components env is not set, should not show the indicator
expect
(
preamble
).
toContain
(
'Next.js'
)
expect
(
output
).
toContain
(
'Next.js'
)
if
(
isTurbopack
)
{
expect
(
preamble
).
toContain
(
'Turbopack'
)
expect
(
output
).
toContain
(
'Turbopack'
)
}
else
{
expect
(
preamble
).
toContain
(
'webpack'
)
expect
(
output
).
toContain
(
'webpack'
)
}
expect
(
preamble
).
not
.
toContain
(
'Cache Components'
)
expect
(
output
).
not
.
toContain
(
'Cache Components'
)
}
})
})
})
function
getPreambleOutput
(
cliOutput
:
string
):
string
{
const
lines
:
string
[]
=
[]
for
(
const
line
of
cliOutput
.
split
(
'
\
n'
))
{
// Capture lines up to and including the "Local:" line
lines
.
push
(
line
.
replace
(
nextVersion
,
'x.y.z'
))
if
(
line
.
includes
(
'Local:'
))
{
break
}
}
return
lines
.
join
(
'
\
n'
).
trim
()
}
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