Skip to content

Commit 1a8a135

Browse files
committed
test: update assertion for next >=15.0.4-canary.18
1 parent c938bb6 commit 1a8a135

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Diff for: tests/integration/simple-app.test.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,13 @@ test<FixtureTestContext>('Test that the simple next app is working', async (ctx)
8383

8484
const notFound = await invokeFunction(ctx, { url: 'route-resolves-to-not-found' })
8585
expect(notFound.statusCode).toBe(404)
86-
expect(notFound.body).toContain('NEXT_NOT_FOUND')
86+
// depending on Next version code found in 404 page can be either NEXT_NOT_FOUND or NEXT_HTTP_ERROR_FALLBACK
87+
// see https://github.com/vercel/next.js/commit/997105d27ebc7bfe01b7e907cd659e5e056e637c that moved from NEXT_NOT_FOUND to NEXT_HTTP_ERROR_FALLBACK
88+
expect(
89+
notFound.body?.includes('NEXT_NOT_FOUND') ||
90+
notFound.body?.includes('NEXT_HTTP_ERROR_FALLBACK'),
91+
'404 page should contain NEXT_NOT_FOUND or NEXT_HTTP_ERROR_FALLBACK code',
92+
).toBe(true)
8793

8894
const notExisting = await invokeFunction(ctx, { url: 'non-exisitng' })
8995
expect(notExisting.statusCode).toBe(404)

0 commit comments

Comments
 (0)