Skip to content

Commit 87342c3

Browse files
authored
test: fixture and tests updates for next@canary (#540)
* test: explicitly mark test route handler as cacheable * test: explicitly mark test route handler as non cacheable
1 parent bac1848 commit 87342c3

File tree

5 files changed

+7
-3
lines changed

5 files changed

+7
-3
lines changed

tests/fixtures/server-components/app/api/revalidate-handler/route.ts

+2
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ export async function GET() {
88

99
return NextResponse.json({ data, time: new Date().toISOString() })
1010
}
11+
12+
export const dynamic = 'force-static'

tests/fixtures/simple/app/redirect/response/route.js

+2
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ import { NextRequest, NextResponse } from 'next/server'
33
export async function GET() {
44
return NextResponse.redirect('https://www.netlify.com/')
55
}
6+
7+
export const dynamic = 'force-dynamic'

tests/fixtures/simple/app/redirect/route.js

+2
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ import { redirect } from 'next/navigation'
33
export async function GET() {
44
return redirect('https://www.netlify.com/')
55
}
6+
7+
export const dynamic = 'force-dynamic'

tests/integration/cache-handler.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ describe('plugin', () => {
326326
})
327327

328328
describe('route', () => {
329-
test<FixtureTestContext>('route handler with revalidate', async (ctx) => {
329+
test<FixtureTestContext>('route handler with cacheable response', async (ctx) => {
330330
await createFixture('server-components', ctx)
331331
await runPlugin(ctx)
332332

tests/integration/simple-app.test.ts

-2
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@ test<FixtureTestContext>('Test that the simple next app is working', async (ctx)
6666
'/image/remote-pattern-2',
6767
'/index',
6868
'/other',
69-
'/redirect',
70-
'/redirect/response',
7169
'/route-resolves-to-not-found',
7270
'404.html',
7371
'500.html',

0 commit comments

Comments
 (0)