Skip to content

Commit c33f1e6

Browse files
committed
fix deploy tests
1 parent e6d9569 commit c33f1e6

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

test/e2e/basepath/error-pages.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ describe('basePath', () => {
8080
// will be the Vercel default 404 page
8181
expect(
8282
await browser.eval('document.documentElement.innerHTML')
83-
).toContain('NOT_FOUND')
83+
).toContain('404: This page could not be found')
8484
} else {
8585
expect(await browser.eval(() => (window as any).next.router.asPath)).toBe(
8686
`${basePath}hello`

test/e2e/basepath/redirect-and-rewrite.test.ts

+7-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { fetchViaHTTP, renderViaHTTP } from 'next-test-utils'
55
describe('basePath', () => {
66
const basePath = '/docs'
77

8-
const { next } = nextTestSetup({
8+
const { next, isNextDeploy } = nextTestSetup({
99
files: __dirname,
1010
nextConfig: {
1111
basePath,
@@ -114,7 +114,9 @@ describe('basePath', () => {
114114
expect(pathname).toBe(`${basePath}/somewhere-else`)
115115
expect(res.status).toBe(307)
116116
const text = await res.text()
117-
expect(text).toContain(`${basePath}/somewhere-else`)
117+
if (!isNextDeploy) {
118+
expect(text).toContain(`${basePath}/somewhere-else`)
119+
}
118120
})
119121

120122
it('should not redirect without basePath without disabling', async () => {
@@ -146,6 +148,8 @@ describe('basePath', () => {
146148
expect(pathname).toBe('/another-destination')
147149
expect(res.status).toBe(307)
148150
const text = await res.text()
149-
expect(text).toContain('/another-destination')
151+
if (!isNextDeploy) {
152+
expect(text).toContain('/another-destination')
153+
}
150154
})
151155
})

0 commit comments

Comments
 (0)