Skip to content

test: adjust assertions for /_not-found being possibly added to prerender manifest #3043

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 31 additions & 25 deletions tests/integration/cache-handler.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,14 +212,17 @@ describe('app router', () => {
console.timeEnd('runPlugin')
// check if the blob entries where successful set on the build plugin
const blobEntries = await getBlobEntries(ctx)
expect(blobEntries.map(({ key }) => decodeBlobKey(key)).sort()).toEqual([
'/404',
'/index',
'/posts/1',
'/posts/2',
'404.html',
'500.html',
])
expect(blobEntries.map(({ key }) => decodeBlobKey(key)).sort()).toEqual(
[
'/404',
nextVersionSatisfies('>=15.4.2-canary.33') ? '/_not-found' : undefined,
'/index',
'/posts/1',
'/posts/2',
'404.html',
'500.html',
].filter(Boolean),
)

// test the function call
const post1 = await invokeFunction(ctx, { url: 'posts/1' })
Expand Down Expand Up @@ -362,23 +365,26 @@ describe('plugin', () => {
await runPlugin(ctx)
// check if the blob entries where successful set on the build plugin
const blobEntries = await getBlobEntries(ctx)
expect(blobEntries.map(({ key }) => decodeBlobKey(key)).sort()).toEqual([
'/404',
'/api/revalidate-handler',
'/api/static/first',
'/api/static/second',
'/api/zero-length-response',
'/index',
'/product/事前レンダリング,test',
'/revalidate-fetch',
'/static-fetch-1',
'/static-fetch-2',
'/static-fetch-3',
'/static-fetch/1',
'/static-fetch/2',
'404.html',
'500.html',
])
expect(blobEntries.map(({ key }) => decodeBlobKey(key)).sort()).toEqual(
[
'/404',
nextVersionSatisfies('>=15.4.2-canary.33') ? '/_not-found' : undefined,
'/api/revalidate-handler',
'/api/static/first',
'/api/static/second',
'/api/zero-length-response',
'/index',
'/product/事前レンダリング,test',
'/revalidate-fetch',
'/static-fetch-1',
'/static-fetch-2',
'/static-fetch-3',
'/static-fetch/1',
'/static-fetch/2',
'404.html',
'500.html',
].filter(Boolean),
)
})
})

Expand Down
58 changes: 32 additions & 26 deletions tests/integration/simple-app.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,26 +95,29 @@ test<FixtureTestContext>('Test that the simple next app is working', async (ctx)
await runPlugin(ctx)
// check if the blob entries where successful set on the build plugin
const blobEntries = await getBlobEntries(ctx)
expect(blobEntries.map(({ key }) => decodeBlobKey(key)).sort()).toEqual([
'/404',
'/api/cached-permanent',
'/api/cached-revalidate',
'/config-redirect',
'/config-redirect/dest',
'/config-rewrite',
'/config-rewrite/dest',
'/image/local',
'/image/migration-from-v4-runtime',
'/image/remote-domain',
'/image/remote-pattern-1',
'/image/remote-pattern-2',
'/index',
'/other',
'/route-resolves-to-not-found',
'404.html',
'500.html',
'fully-static.html',
])
expect(blobEntries.map(({ key }) => decodeBlobKey(key)).sort()).toEqual(
[
'/404',
nextVersionSatisfies('>=15.4.2-canary.33') ? '/_not-found' : undefined,
'/api/cached-permanent',
'/api/cached-revalidate',
'/config-redirect',
'/config-redirect/dest',
'/config-rewrite',
'/config-rewrite/dest',
'/image/local',
'/image/migration-from-v4-runtime',
'/image/remote-domain',
'/image/remote-pattern-1',
'/image/remote-pattern-2',
'/index',
'/other',
'/route-resolves-to-not-found',
'404.html',
'500.html',
'fully-static.html',
].filter(Boolean),
)

// test the function call
const home = await invokeFunction(ctx)
Expand Down Expand Up @@ -385,12 +388,15 @@ test.skipIf(process.env.NEXT_VERSION !== 'canary')<FixtureTestContext>(
await runPlugin(ctx)
// check if the blob entries where successful set on the build plugin
const blobEntries = await getBlobEntries(ctx)
expect(blobEntries.map(({ key }) => decodeBlobKey(key)).sort()).toEqual([
'/404',
'/index',
'404.html',
'500.html',
])
expect(blobEntries.map(({ key }) => decodeBlobKey(key)).sort()).toEqual(
[
'/404',
nextVersionSatisfies('>=15.4.2-canary.33') ? '/_not-found' : undefined,
'/index',
'404.html',
'500.html',
].filter(Boolean),
)

// test the function call
const home = await invokeFunction(ctx)
Expand Down
Loading