Skip to content

Commit b595491

Browse files
committed
test: adjust for /_global-error
1 parent 86c2cb7 commit b595491

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

tests/integration/cache-handler.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import {
1919
} from '../utils/helpers.js'
2020
import {
2121
nextVersionSatisfies,
22+
shouldHaveAppRouterGlobalErrorInPrerenderManifest,
2223
shouldHaveAppRouterNotFoundInPrerenderManifest,
2324
} from '../utils/next-version-helpers.mjs'
2425

@@ -218,6 +219,7 @@ describe('app router', () => {
218219
expect(blobEntries.map(({ key }) => decodeBlobKey(key)).sort()).toEqual(
219220
[
220221
'/404',
222+
shouldHaveAppRouterGlobalErrorInPrerenderManifest() ? '/_global-error' : undefined,
221223
shouldHaveAppRouterNotFoundInPrerenderManifest() ? '/_not-found' : undefined,
222224
'/index',
223225
'/posts/1',
@@ -371,6 +373,7 @@ describe('plugin', () => {
371373
expect(blobEntries.map(({ key }) => decodeBlobKey(key)).sort()).toEqual(
372374
[
373375
'/404',
376+
shouldHaveAppRouterGlobalErrorInPrerenderManifest() ? '/_global-error' : undefined,
374377
shouldHaveAppRouterNotFoundInPrerenderManifest() ? '/_not-found' : undefined,
375378
'/api/revalidate-handler',
376379
'/api/static/first',

tests/integration/simple-app.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import {
3636
} from '../utils/helpers.js'
3737
import {
3838
nextVersionSatisfies,
39+
shouldHaveAppRouterGlobalErrorInPrerenderManifest,
3940
shouldHaveAppRouterNotFoundInPrerenderManifest,
4041
} from '../utils/next-version-helpers.mjs'
4142

@@ -394,6 +395,7 @@ test.skipIf(process.env.NEXT_VERSION !== 'canary')<FixtureTestContext>(
394395
expect(blobEntries.map(({ key }) => decodeBlobKey(key)).sort()).toEqual(
395396
[
396397
'/404',
398+
shouldHaveAppRouterGlobalErrorInPrerenderManifest() ? '/_global-error' : undefined,
397399
shouldHaveAppRouterNotFoundInPrerenderManifest() ? '/_not-found' : undefined,
398400
'/index',
399401
'404.html',

tests/utils/next-version-helpers.mjs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@ export function shouldHaveAppRouterNotFoundInPrerenderManifest() {
3838
return nextVersionSatisfies(isNextCanary() ? '>=15.4.2-canary.33' : '>=15.5.0')
3939
}
4040

41+
export function shouldHaveAppRouterGlobalErrorInPrerenderManifest() {
42+
// https://github.com/vercel/next.js/pull/82444
43+
44+
// this is not used in any stable version yet
45+
return isNextCanary() && nextVersionSatisfies('>=15.5.1-canary.4')
46+
}
47+
4148
/**
4249
* Check if current next version requires React 19
4350
* @param {string} version Next version

0 commit comments

Comments
 (0)