Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit cc027d0

Browse files
committed
test: adjust assertions for /_not-found being possibly added to prerender manifest
1 parent 199d473 commit cc027d0

File tree

2 files changed

+63
-51
lines changed

2 files changed

+63
-51
lines changed

‎tests/integration/cache-handler.test.ts‎

Lines changed: 31 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -212,14 +212,17 @@ describe('app router', () => {
212212
console.timeEnd('runPlugin')
213213
// check if the blob entries where successful set on the build plugin
214214
const blobEntries = await getBlobEntries(ctx)
215-
expect(blobEntries.map(({ key }) => decodeBlobKey(key)).sort()).toEqual([
216-
'/404',
217-
'/index',
218-
'/posts/1',
219-
'/posts/2',
220-
'404.html',
221-
'500.html',
222-
])
215+
expect(blobEntries.map(({ key }) => decodeBlobKey(key)).sort()).toEqual(
216+
[
217+
'/404',
218+
nextVersionSatisfies('>=15.4.2-canary.33') ? '/_not-found' : undefined,
219+
'/index',
220+
'/posts/1',
221+
'/posts/2',
222+
'404.html',
223+
'500.html',
224+
].filter(Boolean),
225+
)
223226

224227
// test the function call
225228
const post1 = await invokeFunction(ctx, { url: 'posts/1' })
@@ -362,23 +365,26 @@ describe('plugin', () => {
362365
await runPlugin(ctx)
363366
// check if the blob entries where successful set on the build plugin
364367
const blobEntries = await getBlobEntries(ctx)
365-
expect(blobEntries.map(({ key }) => decodeBlobKey(key)).sort()).toEqual([
366-
'/404',
367-
'/api/revalidate-handler',
368-
'/api/static/first',
369-
'/api/static/second',
370-
'/api/zero-length-response',
371-
'/index',
372-
'/product/事前レンダリング,test',
373-
'/revalidate-fetch',
374-
'/static-fetch-1',
375-
'/static-fetch-2',
376-
'/static-fetch-3',
377-
'/static-fetch/1',
378-
'/static-fetch/2',
379-
'404.html',
380-
'500.html',
381-
])
368+
expect(blobEntries.map(({ key }) => decodeBlobKey(key)).sort()).toEqual(
369+
[
370+
'/404',
371+
nextVersionSatisfies('>=15.4.2-canary.33') ? '/_not-found' : undefined,
372+
'/api/revalidate-handler',
373+
'/api/static/first',
374+
'/api/static/second',
375+
'/api/zero-length-response',
376+
'/index',
377+
'/product/事前レンダリング,test',
378+
'/revalidate-fetch',
379+
'/static-fetch-1',
380+
'/static-fetch-2',
381+
'/static-fetch-3',
382+
'/static-fetch/1',
383+
'/static-fetch/2',
384+
'404.html',
385+
'500.html',
386+
].filter(Boolean),
387+
)
382388
})
383389
})
384390

‎tests/integration/simple-app.test.ts‎

Lines changed: 32 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -95,26 +95,29 @@ test<FixtureTestContext>('Test that the simple next app is working', async (ctx)
9595
await runPlugin(ctx)
9696
// check if the blob entries where successful set on the build plugin
9797
const blobEntries = await getBlobEntries(ctx)
98-
expect(blobEntries.map(({ key }) => decodeBlobKey(key)).sort()).toEqual([
99-
'/404',
100-
'/api/cached-permanent',
101-
'/api/cached-revalidate',
102-
'/config-redirect',
103-
'/config-redirect/dest',
104-
'/config-rewrite',
105-
'/config-rewrite/dest',
106-
'/image/local',
107-
'/image/migration-from-v4-runtime',
108-
'/image/remote-domain',
109-
'/image/remote-pattern-1',
110-
'/image/remote-pattern-2',
111-
'/index',
112-
'/other',
113-
'/route-resolves-to-not-found',
114-
'404.html',
115-
'500.html',
116-
'fully-static.html',
117-
])
98+
expect(blobEntries.map(({ key }) => decodeBlobKey(key)).sort()).toEqual(
99+
[
100+
'/404',
101+
nextVersionSatisfies('>=15.4.2-canary.33') ? '/_not-found' : undefined,
102+
'/api/cached-permanent',
103+
'/api/cached-revalidate',
104+
'/config-redirect',
105+
'/config-redirect/dest',
106+
'/config-rewrite',
107+
'/config-rewrite/dest',
108+
'/image/local',
109+
'/image/migration-from-v4-runtime',
110+
'/image/remote-domain',
111+
'/image/remote-pattern-1',
112+
'/image/remote-pattern-2',
113+
'/index',
114+
'/other',
115+
'/route-resolves-to-not-found',
116+
'404.html',
117+
'500.html',
118+
'fully-static.html',
119+
].filter(Boolean),
120+
)
118121

119122
// test the function call
120123
const home = await invokeFunction(ctx)
@@ -385,12 +388,15 @@ test.skipIf(process.env.NEXT_VERSION !== 'canary')<FixtureTestContext>(
385388
await runPlugin(ctx)
386389
// check if the blob entries where successful set on the build plugin
387390
const blobEntries = await getBlobEntries(ctx)
388-
expect(blobEntries.map(({ key }) => decodeBlobKey(key)).sort()).toEqual([
389-
'/404',
390-
'/index',
391-
'404.html',
392-
'500.html',
393-
])
391+
expect(blobEntries.map(({ key }) => decodeBlobKey(key)).sort()).toEqual(
392+
[
393+
'/404',
394+
nextVersionSatisfies('>=15.4.2-canary.33') ? '/_not-found' : undefined,
395+
'/index',
396+
'404.html',
397+
'500.html',
398+
].filter(Boolean),
399+
)
394400

395401
// test the function call
396402
const home = await invokeFunction(ctx)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /