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
3f5f6a9c
Commit
3f5f6a9c
authored
Feb 10, 2026
by
Sam Selikoff
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wip
parent
3ae9d4c8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
95 additions
and
92 deletions
+95
-92
stale-time-export.test.ts
...segment-cache/stale-time-export/stale-time-export.test.ts
+95
-92
No files found.
test/e2e/app-dir/segment-cache/stale-time-export/stale-time-export.test.ts
View file @
3f5f6a9c
...
@@ -2,14 +2,16 @@ import { nextTestSetup } from 'e2e-utils'
...
@@ -2,14 +2,16 @@ import { nextTestSetup } from 'e2e-utils'
import
type
*
as
Playwright
from
'playwright'
import
type
*
as
Playwright
from
'playwright'
import
{
createRouterAct
}
from
'router-act'
import
{
createRouterAct
}
from
'router-act'
import
{
retry
}
from
'next-test-utils'
import
{
retry
}
from
'next-test-utils'
;(
process
.
env
.
__NEXT_CACHE_COMPONENTS
?
describe
.
skip
:
describe
)(
import
{
outdent
}
from
'outdent'
'segment cache - export const unstable_staleTime'
,
()
=>
{
const
isCacheComponentsEnabled
=
process
.
env
.
__NEXT_CACHE_COMPONENTS
===
'true'
describe
(
'segment cache - export const unstable_staleTime'
,
()
=>
{
const
{
next
,
isNextDev
}
=
nextTestSetup
({
const
{
next
,
isNextDev
}
=
nextTestSetup
({
files
:
__dirname
,
files
:
__dirname
,
})
})
if
(
isNextDev
)
{
if
(
isNextDev
||
isCacheComponentsEnabled
)
{
test
(
'skipped in development'
,
()
=>
{})
test
(
'skipped in development'
,
()
=>
{})
return
return
}
}
...
@@ -82,8 +84,7 @@ import { retry } from 'next-test-utils'
...
@@ -82,8 +84,7 @@ import { retry } from 'next-test-utils'
// segment cache during navigation, which is a more significant change.
// segment cache during navigation, which is a more significant change.
//
//
// The unstable_staleTime segment config works correctly for prefetched routes.
// The unstable_staleTime segment config works correctly for prefetched routes.
}
})
)
describe
(
'unstable_staleTime - layout build error'
,
()
=>
{
describe
(
'unstable_staleTime - layout build error'
,
()
=>
{
const
{
next
,
isNextDev
,
skipped
}
=
nextTestSetup
({
const
{
next
,
isNextDev
,
skipped
}
=
nextTestSetup
({
...
@@ -99,20 +100,21 @@ describe('unstable_staleTime - layout build error', () => {
...
@@ -99,20 +100,21 @@ describe('unstable_staleTime - layout build error', () => {
it
(
'should error when unstable_staleTime is used in a layout'
,
async
()
=>
{
it
(
'should error when unstable_staleTime is used in a layout'
,
async
()
=>
{
await
next
.
patchFile
(
await
next
.
patchFile
(
'app/layout.tsx'
,
'app/layout.tsx'
,
`export const unstable_staleTime = 60
outdent
`
export const unstable_staleTime = 60
export default function RootLayout({
export default function RootLayout({
children,
children,
}: {
}: {
children: React.ReactNode
children: React.ReactNode
}) {
}) {
return (
return (
<html lang="en">
<html lang="en">
<body>{children}</body>
<body>{children}</body>
</html>
</html>
)
)
}
}
`
,
`
,
async
()
=>
{
async
()
=>
{
try
{
try
{
await
next
.
start
()
await
next
.
start
()
...
@@ -149,10 +151,11 @@ describe('unstable_staleTime - cacheComponents build error', () => {
...
@@ -149,10 +151,11 @@ describe('unstable_staleTime - cacheComponents build error', () => {
it
(
'should error when unstable_staleTime is used with cacheComponents'
,
async
()
=>
{
it
(
'should error when unstable_staleTime is used with cacheComponents'
,
async
()
=>
{
await
next
.
patchFile
(
await
next
.
patchFile
(
'next.config.js'
,
'next.config.js'
,
`module.exports = {
outdent
`
module.exports = {
cacheComponents: true,
cacheComponents: true,
}
}
`
,
`
,
async
()
=>
{
async
()
=>
{
try
{
try
{
await
next
.
start
()
await
next
.
start
()
...
...
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