Unverified Commit 3ca20b5a authored by Josh Story's avatar Josh Story Committed by GitHub

test: migrate Pages Router deploy exclusions to force gates (#98157)

## Summary

Migrate the remaining Pages Router, API route, i18n, custom route,
rewrite, redirect, and error-page deployment exclusions to `@force-gate`
and remove their `skipDeployment`/`skipped` control flow. This stack is
rooted at canary and independent of #98430; it preserves deployment
coverage already enabled on canary.

The custom-app-render and client-max-body-size files covered by #98994
and #98911 are omitted.

## Verification

- Compared test registration against canary in development, production,
and deploy modes with test bodies and hooks disabled (Webpack). Existing
active deployment assertions are preserved; development/production test
selection is unchanged apart from replacing empty skip placeholders with
skipped real tests.
- TypeScript, Prettier, and ESLint checks passed. Registration probes
use a default config for lazy predicates and do not exercise fixture
setup or test bodies.
- Full bootstrap attempted, but the local native SWC build fails at
`cargo metadata` with `EPERM`; full integration/deployment execution
remains for CI.

<!-- NEXT_JS_LLM -->

---------
Co-authored-by: 's avatarJamiboy Mohammad <jamiboym@gmail.com>
parent 4f392ad7
......@@ -34,6 +34,9 @@ module.exports = {
}
`
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// It currently avoids creating five deployments rather than documenting an incompatibility.
// @force-gate !deploy
describe('404-page-router', () => {
const { next } = nextTestSetup({
files: {
......@@ -49,13 +52,6 @@ describe('404-page-router', () => {
(options) => {
const isDev = (global as any).isNextDev
if ((global as any).isNextDeploy) {
// TODO: investigate condensing these tests to avoid
// 5 separate deploys for this one test
it('should skip for deploy', () => {})
return
}
beforeAll(async () => {
// Only add in the middleware if we're testing with middleware enabled.
if (options.middleware) {
......
import { nextTestSetup, isNextStart } from 'e2e-utils'
;(process.env.TURBOPACK_DEV && isNextStart ? describe.skip : describe)(
'API routes',
() => {
const { next, skipped } = nextTestSetup({
files: __dirname,
// Assertions don't apply to deploy mode (output differs vs. local Next.js server).
skipDeployment: true,
})
if (skipped) return
import { nextTestSetup } from 'e2e-utils'
// TODO(deploy-test-completion): Assertions may differ from a local Next.js
// server when deployed.
// @force-gate !deploy
// @force-gate !start || !turbopackDev
describe('API routes', () => {
const { next } = nextTestSetup({
files: __dirname,
})
it('should return data when catch-all', async () => {
const data = await next
.fetch('/api/users/1', {})
.then((res) => res.ok && res.json())
it('should return data when catch-all', async () => {
const data = await next
.fetch('/api/users/1', {})
.then((res) => res.ok && res.json())
expect(data).toEqual({ slug: ['1'] })
})
expect(data).toEqual({ slug: ['1'] })
})
it('should return redirect when catch-all with index and trailing slash', async () => {
const res = await next.fetch('/api/users/', {
redirect: 'manual',
})
expect(res.status).toBe(308)
const text = await res.text()
expect(text).toEqual('/api/users')
it('should return redirect when catch-all with index and trailing slash', async () => {
const res = await next.fetch('/api/users/', {
redirect: 'manual',
})
expect(res.status).toBe(308)
const text = await res.text()
expect(text).toEqual('/api/users')
})
it('should return data when catch-all with index and trailing slash', async () => {
const data = await next
.fetch('/api/users/', {})
.then((res) => res.ok && res.json())
it('should return data when catch-all with index and trailing slash', async () => {
const data = await next
.fetch('/api/users/', {})
.then((res) => res.ok && res.json())
expect(data).toEqual({})
})
expect(data).toEqual({})
})
it('should return data when catch-all with index and no trailing slash', async () => {
const data = await next
.fetch('/api/users', {})
.then((res) => res.ok && res.json())
it('should return data when catch-all with index and no trailing slash', async () => {
const data = await next
.fetch('/api/users', {})
.then((res) => res.ok && res.json())
expect(data).toEqual({})
})
}
)
expect(data).toEqual({})
})
})
......@@ -6,17 +6,18 @@ import {
import { nextTestSetup, isNextDev } from 'e2e-utils'
import json from './big.json'
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// It likely expects a local build failure instead of a successful deployment.
// @force-gate !deploy
describe('API routes', () => {
const { next, skipped } = nextTestSetup({
const { next } = nextTestSetup({
files: __dirname,
dependencies: {
'http-proxy': 'latest',
cors: 'latest',
},
skipDeployment: true,
disableAutoSkewProtection: true,
})
if (skipped) return
it('should not strip .json from API route', async () => {
const res = await next.fetch('/api/hello.json')
......@@ -595,18 +596,19 @@ describe('API routes', () => {
}
})
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// It likely expects a local build failure instead of a successful deployment.
// @force-gate !deploy
describe('API routes output export error', () => {
const { next, skipped } = nextTestSetup({
const { next } = nextTestSetup({
files: __dirname,
dependencies: {
'http-proxy': 'latest',
cors: 'latest',
},
skipStart: true,
skipDeployment: true,
disableAutoSkewProtection: true,
})
if (skipped) return
it('should show error with output export', async () => {
if (isNextDev) return
......
......@@ -5,62 +5,56 @@ import { waitForNoRedbox, retry } from 'next-test-utils'
// This is skipped when deployed because there are no assertions outside of next start/next dev
// @force-gate !deploy
describe('app dir', () => {
const { next, isNextDev, isNextStart, isNextDeploy } = nextTestSetup({
const { next } = nextTestSetup({
files: __dirname,
})
if (isNextDeploy) {
it('is excluded from deploy testing by @force-gate', () => {})
}
if (isNextStart) {
describe('Loading', () => {
it('should render loading.js in initial html for slow page', async () => {
const $ = await next.render$('/page-with-loading')
expect($('#loading').text()).toBe('Loading...')
})
// @force-gate start
describe('Loading', () => {
it('should render loading.js in initial html for slow page', async () => {
const $ = await next.render$('/page-with-loading')
expect($('#loading').text()).toBe('Loading...')
})
}
if (isNextDev) {
describe('HMR', () => {
it('should not cause error when removing loading.js', async () => {
const browser = await next.browser('/page-with-loading')
await retry(async () => {
const headline = await browser.elementByCss('h1').text()
expect(headline).toBe('hello from slow page')
})
})
const cliOutputLength = next.cliOutput.length
// @force-gate dev
describe('HMR', () => {
it('should not cause error when removing loading.js', async () => {
const browser = await next.browser('/page-with-loading')
await next.renameFile(
'app/page-with-loading/loading.js',
'app/page-with-loading/_loading.js'
)
await retry(async () => {
const headline = await browser.elementByCss('h1').text()
expect(headline).toBe('hello from slow page')
})
await retry(async () => {
expect(next.cliOutput.slice(cliOutputLength)).toInclude(
'GET /page-with-loading 200'
)
})
const cliOutputLength = next.cliOutput.length
// It should not have an error
await waitForNoRedbox(browser)
await next.renameFile(
'app/page-with-loading/loading.js',
'app/page-with-loading/_loading.js'
)
// HMR should still work
await next.patchFile(
'app/page-with-loading/page.js',
(content) =>
content.replace('hello from slow page', 'hello from new page'),
async () =>
retry(async () => {
const headline = await browser.elementByCss('h1').text()
expect(headline).toBe('hello from new page')
await browser.close()
})
await retry(async () => {
expect(next.cliOutput.slice(cliOutputLength)).toInclude(
'GET /page-with-loading 200'
)
})
// It should not have an error
await waitForNoRedbox(browser)
// HMR should still work
await next.patchFile(
'app/page-with-loading/page.js',
(content) =>
content.replace('hello from slow page', 'hello from new page'),
async () =>
retry(async () => {
const headline = await browser.elementByCss('h1').text()
expect(headline).toBe('hello from new page')
await browser.close()
})
)
})
}
})
})
......@@ -10,6 +10,8 @@ import {
renderViaHTTP,
} from 'next-test-utils'
// TODO(deploy-test-completion): Remove this suite from the deploy manifest.
// It was excluded as a known deploy failure without a documented root cause.
describe('basePath', () => {
const basePath = '/docs'
......@@ -148,91 +150,90 @@ describe('basePath', () => {
})
if (!isNextDev) {
if (!isNextDeploy) {
it('should add basePath to routes-manifest', async () => {
const routesManifest = JSON.parse(
await next.readFile('.next/routes-manifest.json')
)
expect(routesManifest.basePath).toBe(basePath)
})
// @force-gate !deploy
it('should add basePath to routes-manifest', async () => {
const routesManifest = JSON.parse(
await next.readFile('.next/routes-manifest.json')
)
expect(routesManifest.basePath).toBe(basePath)
})
it('should prefetch pages correctly when manually called', async () => {
const browser = await next.browser(`${basePath}/other-page`)
await browser.eval('window.next.router.prefetch("/gssp")')
// @force-gate !deploy
it('should prefetch pages correctly when manually called', async () => {
const browser = await next.browser(`${basePath}/other-page`)
await browser.eval('window.next.router.prefetch("/gssp")')
let chunk = getClientBuildManifestLoaderChunkUrlPath(
next.testDir,
'/gssp'
)
let chunk = getClientBuildManifestLoaderChunkUrlPath(
next.testDir,
'/gssp'
)
await check(async () => {
const links = await browser.elementsByCss('link[rel=prefetch]')
await check(async () => {
const links = await browser.elementsByCss('link[rel=prefetch]')
for (const link of links) {
const href = await link.getAttribute('href')
if (href.includes(chunk)) {
return true
}
for (const link of links) {
const href = await link.getAttribute('href')
if (href.includes(chunk)) {
return true
}
}
const scripts = await browser.elementsByCss('script')
const scripts = await browser.elementsByCss('script')
for (const script of scripts) {
const src = await script.getAttribute('src')
if (src.includes(chunk)) {
return true
}
for (const script of scripts) {
const src = await script.getAttribute('src')
if (src.includes(chunk)) {
return true
}
return false
}, true)
})
}
return false
}, true)
})
it('should prefetch pages correctly in viewport with <Link>', async () => {
const browser = await next.browser(`${basePath}/hello`)
await browser.eval('window.next.router.prefetch("/gssp")')
await check(async () => {
const hrefs = await browser.eval(
`Object.keys(window.next.router.sdc)`
)
hrefs.sort()
assert.deepEqual(
hrefs.map((href) =>
new URL(href).pathname.replace(/\/_next\/data\/[^/]+/, '')
),
[
`${basePath}/gsp.json`,
`${basePath}/index.json`,
// `${basePath}/index/index.json`,
]
)
let chunkGsp = getClientBuildManifestLoaderChunkUrlPath(
next.testDir,
'/gsp'
)
let chunkGssp = getClientBuildManifestLoaderChunkUrlPath(
next.testDir,
'/gssp'
)
let chunkOtherPage = getClientBuildManifestLoaderChunkUrlPath(
next.testDir,
'/other-page'
)
const prefetches = await browser.eval(
`[].slice.call(document.querySelectorAll("link[rel=prefetch]")).map((e) => new URL(e.href).pathname)`
)
expect(prefetches).toContainEqual(expect.stringContaining(chunkGsp))
expect(prefetches).toContainEqual(expect.stringContaining(chunkGssp))
expect(prefetches).toContainEqual(
expect.stringContaining(chunkOtherPage)
)
return 'yes'
}, 'yes')
})
}
// @force-gate !deploy
it('should prefetch pages correctly in viewport with <Link>', async () => {
const browser = await next.browser(`${basePath}/hello`)
await browser.eval('window.next.router.prefetch("/gssp")')
await check(async () => {
const hrefs = await browser.eval(`Object.keys(window.next.router.sdc)`)
hrefs.sort()
assert.deepEqual(
hrefs.map((href) =>
new URL(href).pathname.replace(/\/_next\/data\/[^/]+/, '')
),
[
`${basePath}/gsp.json`,
`${basePath}/index.json`,
// `${basePath}/index/index.json`,
]
)
let chunkGsp = getClientBuildManifestLoaderChunkUrlPath(
next.testDir,
'/gsp'
)
let chunkGssp = getClientBuildManifestLoaderChunkUrlPath(
next.testDir,
'/gssp'
)
let chunkOtherPage = getClientBuildManifestLoaderChunkUrlPath(
next.testDir,
'/other-page'
)
const prefetches = await browser.eval(
`[].slice.call(document.querySelectorAll("link[rel=prefetch]")).map((e) => new URL(e.href).pathname)`
)
expect(prefetches).toContainEqual(expect.stringContaining(chunkGsp))
expect(prefetches).toContainEqual(expect.stringContaining(chunkGssp))
expect(prefetches).toContainEqual(
expect.stringContaining(chunkOtherPage)
)
return 'yes'
}, 'yes')
})
}
it('should serve public file with basePath correctly', async () => {
......@@ -402,35 +403,35 @@ describe('basePath', () => {
)
})
if (!isNextDeploy) {
it('should navigate an absolute local url with basePath', async () => {
const browser = await next.browser(
`${basePath}/absolute-url-basepath?port=${next.appPort}`
)
await browser.eval('window._didNotNavigate = true')
await browser.waitForElementByCss('#absolute-link').click()
const text = await browser
.waitForElementByCss('#something-else-page')
.text()
// @force-gate !deploy
it('should navigate an absolute local url with basePath', async () => {
const browser = await next.browser(
`${basePath}/absolute-url-basepath?port=${next.appPort}`
)
await browser.eval('window._didNotNavigate = true')
await browser.waitForElementByCss('#absolute-link').click()
const text = await browser
.waitForElementByCss('#something-else-page')
.text()
expect(text).toBe('something else')
expect(await browser.eval('window._didNotNavigate')).toBe(true)
})
expect(text).toBe('something else')
expect(await browser.eval('window._didNotNavigate')).toBe(true)
})
it('should navigate an absolute local url without basePath', async () => {
const browser = await next.browser(
`${basePath}/absolute-url-no-basepath?port=${next.appPort}`
)
await browser.waitForElementByCss('#absolute-link').click()
await check(
() => browser.eval(() => location.pathname),
'/rewrite-no-basepath'
)
const text = await browser.elementByCss('body').text()
// @force-gate !deploy
it('should navigate an absolute local url without basePath', async () => {
const browser = await next.browser(
`${basePath}/absolute-url-no-basepath?port=${next.appPort}`
)
await browser.waitForElementByCss('#absolute-link').click()
await check(
() => browser.eval(() => location.pathname),
'/rewrite-no-basepath'
)
const text = await browser.elementByCss('body').text()
expect(text).toContain('Example Domain')
})
}
expect(text).toContain('Example Domain')
})
it('should show the hello page under the /docs prefix', async () => {
const browser = await next.browser(`${basePath}/hello`)
......
import { nextTestSetup } from 'e2e-utils'
// Deploy mode exclusion: This suite aborts a raw client connection, but
// a hosting proxy changes cancellation propagation before Next.js receives it.
describe('streaming responses cancel inner stream after disconnect', () => {
const { next } = nextTestSetup({
files: __dirname,
......
......@@ -4,13 +4,13 @@ import {
getClientBuildManifestLoaderChunkUrlPath,
} from 'next-test-utils'
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// Assertions don't apply to deploy mode (output differs vs. local Next.js server).
// @force-gate !deploy
describe('Client 404', () => {
const { next, skipped } = nextTestSetup({
const { next } = nextTestSetup({
files: __dirname,
// Assertions don't apply to deploy mode (output differs vs. local Next.js server).
skipDeployment: true,
})
if (skipped) return
beforeAll(async () => {
// pre-build the home page so that navigating to it from the
......
......@@ -8,18 +8,17 @@ import {
} from 'next-test-utils'
import { nextTestSetup } from 'e2e-utils'
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// It likely asserts local CLI or runtime output that deploy tests do not expose.
// @force-gate !deploy
describe('Conflict between app file and pages file', () => {
const { next, isNextDev, isNextStart, skipped } = nextTestSetup({
const { next } = nextTestSetup({
files: __dirname,
skipDeployment: true,
skipStart: true,
})
if (skipped) {
return
}
if (isNextStart) {
// @force-gate start
describe('production', () => {
it('should print error for conflicting app/page', async () => {
const { cliOutput } = await next.build()
if (process.env.IS_TURBOPACK_TEST) {
......@@ -45,7 +44,7 @@ describe('Conflict between app file and pages file', () => {
expect(cliOutput).not.toContain('/non-conflict-pages')
expect(cliOutput).not.toContain('/non-conflict')
})
}
})
async function containConflictsError(browser, conflicts) {
await retry(async () => {
......@@ -66,7 +65,8 @@ describe('Conflict between app file and pages file', () => {
})
}
if (isNextDev) {
// @force-gate dev
describe('development', () => {
it('should show error overlay for /another', async () => {
await next.start()
const browser = await next.browser('/another')
......@@ -123,5 +123,5 @@ describe('Conflict between app file and pages file', () => {
await waitForRedbox(browser)
await containConflictsError(browser, [['pages/index.js', 'app/page.js']])
})
}
})
})
......@@ -4,17 +4,20 @@ import { retry } from 'next-test-utils'
const customErrNo404Match =
/You have added a custom \/_error page without a custom \/404 page/
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// It likely asserts local CLI or runtime output that deploy tests do not expose.
// @force-gate !deploy
describe('Custom _error', () => {
const { next, isNextDev, isNextStart } = nextTestSetup({
const { next } = nextTestSetup({
files: __dirname,
dependencies: {
react: '19.3.0-canary-fef12a01-20260413',
'react-dom': '19.3.0-canary-fef12a01-20260413',
},
skipDeployment: true,
})
if (isNextDev) {
// @force-gate dev
describe('development', () => {
it('should not warn with /_error and /404 when rendering error first', async () => {
const outputIndex = next.cliOutput.length
await next.patchFile('pages/404.js', 'export default <h1>')
......@@ -57,9 +60,10 @@ describe('Custom _error', () => {
expect(html).toContain('An error 404 occurred on server')
})
})
}
})
if (isNextStart) {
// @force-gate start
describe('production', () => {
it('should not contain /_error in build output', async () => {
expect(next.cliOutput).toMatch(/ƒ .*?\/404/)
expect(next.cliOutput).not.toMatch(/ƒ .*?\/_error/)
......@@ -69,5 +73,5 @@ describe('Custom _error', () => {
const html = await next.render('/')
expect(html).toMatch(/Custom error/)
})
}
})
})
import { nextTestSetup } from 'e2e-utils'
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// Assertions don't apply to deploy mode (output differs vs. local Next.js server).
// @force-gate !deploy
describe('Custom routes i18n with index redirect', () => {
const { next, skipped } = nextTestSetup({
const { next } = nextTestSetup({
files: __dirname,
// Assertions don't apply to deploy mode (output differs vs. local Next.js server).
skipDeployment: true,
})
if (skipped) return
it('should respond to default locale redirects correctly for index redirect', async () => {
for (const [path, dest] of [
......
......@@ -3,13 +3,14 @@ import cheerio from 'cheerio'
import { findPort, retry } from 'next-test-utils'
import { nextTestSetup, isNextDev } from 'e2e-utils'
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// It likely mutates files in the isolated local fixture after setup.
// @force-gate !deploy
describe('Custom routes i18n', () => {
const { next, skipped } = nextTestSetup({
const { next } = nextTestSetup({
files: __dirname,
skipStart: true,
skipDeployment: true,
})
if (skipped) return
let server: http.Server
let externalPort: number
......
......@@ -12,16 +12,17 @@ import {
fetchViaRawHttp,
retry,
} from 'next-test-utils'
import { nextTestSetup, isNextDev, isNextStart } from 'e2e-utils'
import { nextTestSetup, isNextDev } from 'e2e-utils'
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// It likely asserts local CLI or runtime output that deploy tests do not expose.
// @force-gate !deploy
describe('Custom routes', () => {
const { next, skipped } = nextTestSetup({
const { next } = nextTestSetup({
files: __dirname,
skipStart: true,
disableAutoSkewProtection: true,
skipDeployment: true,
})
if (skipped) return
let externalServerPort: number
let externalServer: http.Server
......@@ -3473,16 +3474,17 @@ describe('Custom routes', () => {
})
}
})
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// It likely asserts local CLI or runtime output that deploy tests do not expose.
// @force-gate !deploy
describe('Custom routes no-op rewrite', () => {
const { next, isTurbopack, isNextStart, skipped } = nextTestSetup({
const { next, isTurbopack, isNextStart } = nextTestSetup({
files: __dirname,
skipStart: true,
env: {
ADD_NOOP_REWRITE: 'true',
},
skipDeployment: true,
})
if (skipped) return
if (isTurbopack && isNextStart) {
it('skipped - not supported in turbopack build mode', () => {})
return
......@@ -3530,14 +3532,15 @@ describe('Custom routes no-op rewrite', () => {
})
})
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// It likely asserts local CLI or runtime output that deploy tests do not expose.
// @force-gate !deploy
describe('Custom routes solo types', () => {
const { next, skipped } = nextTestSetup({
const { next } = nextTestSetup({
files: __dirname,
skipStart: true,
disableAutoSkewProtection: true,
skipDeployment: true,
})
if (skipped) return
let externalServer: http.Server
let externalServerPort: number
......@@ -3653,7 +3656,8 @@ describe('Custom routes solo types', () => {
}
})
})
;(isNextStart ? describe : describe.skip)('Custom routes export', () => {
// @force-gate start
describe('Custom routes export', () => {
const { next } = nextTestSetup({
files: __dirname,
skipStart: true,
......
......@@ -113,16 +113,16 @@ async function waitForCallbackTimestampToStabilize(
)
}
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// It likely asserts local CLI or runtime output that deploy tests do not expose.
// @force-gate !deploy
describe('deferred-entries', () => {
const { next, isNextStart, skipped } = nextTestSetup({
const { next, isNextStart } = nextTestSetup({
files: __dirname,
skipDeployment: true,
skipStart: true,
dependencies: {},
})
if (skipped) return
beforeAll(async () => {
// Clear log files before starting
const entryLogPath = path.join(next.testDir, '.entry-log')
......
......@@ -16,15 +16,12 @@ function getData(html: string) {
// It likely expects a local build failure instead of a successful deployment.
// @force-gate !deploy
describe('Test Draft Mode', () => {
const { next, isNextDev, isNextStart, isNextDeploy } = nextTestSetup({
const { next } = nextTestSetup({
files: __dirname,
})
if (isNextDeploy) {
it('is excluded from deploy testing by @force-gate', () => {})
}
if (isNextDev) {
// @force-gate dev
describe('development', () => {
it('should start development application', async () => {
const html = await next.render('/')
expect(html).toBeTruthy()
......@@ -93,9 +90,10 @@ describe('Test Draft Mode', () => {
const setCookie = res.headers.get('set-cookie')
expect(setCookie).toBeTruthy()
})
}
})
if (isNextStart) {
// @force-gate start
describe('production', () => {
let cookieString: string
let initialRand: string
const getOpts = () => ({ headers: { Cookie: cookieString } })
......@@ -216,5 +214,5 @@ describe('Test Draft Mode', () => {
draftMode: true,
})
})
}
})
})
import { nextTestSetup, isNextDev } from 'e2e-utils'
import { runTests } from './shared'
// Deploy mode exclusion: The assertions exercise behavior specific to the local Next.js server.
// Some assertions (`should not decode slashes`, `should serve file with
// plus from public/static folder`) depend on local Next.js URL handling
// and don't apply to Vercel's deploy infrastructure.
// @force-gate !deploy
describe('Dynamic Routing', () => {
const { next, isTurbopack, skipped } = nextTestSetup({
const { next, isTurbopack } = nextTestSetup({
files: __dirname,
disableAutoSkewProtection: true,
// Some assertions (`should not decode slashes`, `should serve file with
// plus from public/static folder`) depend on local Next.js URL handling
// and don't apply to Vercel's deploy infrastructure.
skipDeployment: true,
})
if (skipped) return
runTests({ next, isNextDev, isTurbopack, middlewareEnabled: false })
})
......@@ -3,21 +3,21 @@ import cheerio from 'cheerio'
import { nextTestSetup, isNextDev } from 'e2e-utils'
import { findPort } from 'next-test-utils'
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// Vercel deployment fails to build/deploy this fixture in CI; skip in deploy mode.
// @force-gate !deploy
describe('Fetch polyfill', () => {
let apiServerPort: number
let apiServer: http.Server
const { next, skipped } = nextTestSetup({
const { next } = nextTestSetup({
files: __dirname,
skipStart: true,
dependencies: {
react: '19.3.0-canary-fef12a01-20260413',
'react-dom': '19.3.0-canary-fef12a01-20260413',
},
// Vercel deployment fails to build/deploy this fixture in CI; skip in deploy mode.
skipDeployment: true,
})
if (skipped) return
beforeAll(async () => {
apiServerPort = await findPort()
......
......@@ -15,13 +15,13 @@ function getData(html: string) {
}
}
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// Assertions don't apply to deploy mode (output differs vs. local Next.js server).
// @force-gate !deploy
describe('ServerSide Props Preview Mode', () => {
const { next, skipped } = nextTestSetup({
const { next } = nextTestSetup({
files: __dirname,
// Assertions don't apply to deploy mode (output differs vs. local Next.js server).
skipDeployment: true,
})
if (skipped) return
if (isNextStart) {
it('should compile successfully', async () => {
......
......@@ -2,13 +2,11 @@ import { join } from 'path'
import { FileRef, nextTestSetup } from 'e2e-utils'
import { check } from 'next-test-utils'
// TODO: investigate tests failures on deploy
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// The source only records that these assertions fail after deployment; the root cause is unknown.
// @force-gate !deploy
describe('i18n-data-fetching-redirect', () => {
// TODO: investigate tests failures on deploy
if ((global as any).isNextDeploy) {
it('should skip temporarily', () => {})
return
}
const { next } = nextTestSetup({
files: {
pages: new FileRef(join(__dirname, 'app/pages')),
......
......@@ -12,20 +12,19 @@ function checkDataRoute(data: any, page: string) {
expect(data.pageProps).toHaveProperty('page', page)
}
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// This test skips deployment because env vars that are doubled underscore prefixed
// are not supported.
// @force-gate !deploy
describe('i18n-data-route', () => {
const { next, skipped } = nextTestSetup({
const { next } = nextTestSetup({
files: __dirname,
// This test skips deployment because env vars that are doubled underscore prefixed
// are not supported.
skipDeployment: true,
env: {
// Disable internal header stripping so we can test the invoke output.
__NEXT_NO_STRIP_INTERNAL_HEADERS: '1',
},
})
if (skipped) return
describe('with locale prefix', () => {
describe.each(i18n.locales)('/%s', (locale) => {
const prefixed = pages.map((page) => ({
......
......@@ -13,17 +13,14 @@ async function verify(res, locale) {
expect($('#router-locale').text()).toBe(locale)
}
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// TODO: re-enable after this behavior is corrected
// @force-gate !deploy
describe('i18n-disallow-multiple-locales', () => {
const { next, skipped } = nextTestSetup({
const { next } = nextTestSetup({
files: __dirname,
// TODO: re-enable after this behavior is corrected
skipDeployment: true,
})
if (skipped) {
return
}
it('should verify the default locale works', async () => {
const res = await next.fetch('/', { redirect: 'manual' })
......
......@@ -7,13 +7,14 @@ import { nextTestSetup, isNextDev, type NextInstance } from 'e2e-utils'
type BrowserOptions = Parameters<NextInstance['browser']>[1]
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// It likely mutates files in the isolated local fixture after setup.
// @force-gate !deploy
describe('i18n Support basePath', () => {
const { next, skipped } = nextTestSetup({
const { next } = nextTestSetup({
files: __dirname,
skipStart: true,
skipDeployment: true,
})
if (skipped) return
const ctx: Record<string, any> = {
basePath: '/docs',
......
import { nextTestSetup } from 'e2e-utils'
import { retry } from 'next-test-utils'
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// Assertions don't apply to deploy mode (output differs vs. local Next.js server).
// @force-gate !deploy
describe('Custom routes i18n custom error', () => {
const { next, skipped } = nextTestSetup({
const { next } = nextTestSetup({
files: __dirname,
// Assertions don't apply to deploy mode (output differs vs. local Next.js server).
skipDeployment: true,
})
if (skipped) return
const locales = ['en', 'fr', 'de', 'it']
......
......@@ -9,13 +9,14 @@ import assert from 'assert'
type BrowserOptions = Parameters<NextInstance['browser']>[1]
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// It likely expects a local build failure instead of a successful deployment.
// @force-gate !deploy
describe('i18n Support', () => {
const { next, skipped } = nextTestSetup({
const { next } = nextTestSetup({
files: __dirname,
skipStart: true,
skipDeployment: true,
})
if (skipped) return
const ctx: Record<string, any> = {
basePath: '',
......
......@@ -2,15 +2,15 @@
import { nextTestSetup, isNextDev } from 'e2e-utils'
import { retry } from 'next-test-utils'
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// Vercel's deploy infrastructure normalizes nested `/index/index/index`
// paths differently from Next.js's local server, so the routing
// assertions here are local-only.
// @force-gate !deploy
describe('nested index.js', () => {
const { next, isTurbopack, skipped } = nextTestSetup({
const { next, isTurbopack } = nextTestSetup({
files: __dirname,
// Vercel's deploy infrastructure normalizes nested `/index/index/index`
// paths differently from Next.js's local server, so the routing
// assertions here are local-only.
skipDeployment: true,
})
if (skipped) return
it('should ssr page /', async () => {
const $ = await next.render$('/')
......
import { nextTestSetup, isNextDev, isNextStart } from 'e2e-utils'
import { retry } from 'next-test-utils'
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// It likely asserts local CLI or runtime output that deploy tests do not expose.
// @force-gate !deploy
describe('Errors on invalid custom routes', () => {
const { next, skipped } = nextTestSetup({
const { next } = nextTestSetup({
files: __dirname,
skipStart: true,
skipDeployment: true,
})
if (skipped) return
const writeConfig = async (routes: any, type = 'redirects') => {
await next.patchFile(
......
import { nextTestSetup } from 'e2e-utils'
// Deploy mode exclusion: This suite asserts local CLI or runtime logs that deployments do not expose.
// The test asserts on `next.cliOutput`, expecting the local
// `next build` failure message ("To use a multi-match in the
// destination..."). In deploy mode `next.cliOutput` contains the
// Vercel deploy log, which doesn't surface the same Next.js build
// error string at the top level, so the assertions don't apply.
// @force-gate !deploy
describe('Custom routes invalid multi-match', () => {
const { next, isNextDeploy, skipped } = nextTestSetup({
const { next } = nextTestSetup({
files: __dirname,
disableAutoSkewProtection: true,
// The test asserts on `next.cliOutput`, expecting the local
// `next build` failure message ("To use a multi-match in the
// destination..."). In deploy mode `next.cliOutput` contains the
// Vercel deploy log, which doesn't surface the same Next.js build
// error string at the top level, so the assertions don't apply.
skipDeployment: true,
})
if (skipped) return
if (isNextDeploy) return
it('should show error for invalid multi-match', async () => {
await next.render('/random')
......
......@@ -4,12 +4,13 @@ import { getDeterministicOutput } from '../app-dir/cache-components-errors/utils
const partialPrefetching = !!process.env.__NEXT_PARTIAL_PREFETCHING
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// It likely asserts local CLI or runtime output that deploy tests do not expose.
// @force-gate !deploy
describe('Validations for <Link legacyBehavior>', () => {
const { next, skipped } = nextTestSetup({
const { next } = nextTestSetup({
files: __dirname,
skipDeployment: true,
})
if (skipped) return
let previousOutputIndex = 0
beforeEach(() => {
......
......@@ -5,12 +5,9 @@ import http from 'http'
import assert from 'assert'
import { check, renderViaHTTP, waitFor } from 'next-test-utils'
// Deploy mode exclusion: This suite runs an in-test HTTP proxy in front of the local Next.js server.
// @force-gate !deploy
describe('manual-client-base-path', () => {
if ((global as any).isNextDeploy) {
it('should skip deploy', () => {})
return
}
let server: http.Server
let appPort: string
const basePath = '/docs-proxy'
......
......@@ -2,10 +2,12 @@ import { nextTestSetup } from 'e2e-utils'
import { check, waitFor } from 'next-test-utils'
import path from 'path'
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// It likely mutates files in the isolated local fixture after setup.
// @force-gate !deploy
describe('multi-zone', () => {
const { next, isNextDev, skipped } = nextTestSetup({
const { next, isNextDev } = nextTestSetup({
files: path.join(__dirname, 'app'),
skipDeployment: true,
buildCommand: 'pnpm build',
startCommand: (global as any).isNextDev ? 'pnpm dev' : 'pnpm start',
serverReadyPattern: /Next mode: (production|development)/,
......@@ -20,10 +22,6 @@ describe('multi-zone', () => {
dependencies: require('./app/package.json').dependencies,
})
if (skipped) {
return
}
it.each([
{ pathname: '/', content: ['hello from host app'] },
{ pathname: '/guest', content: ['hello from guest app'] },
......
......@@ -3,6 +3,8 @@ import path from 'path'
const appDir = path.join(__dirname, 'material-ui')
// TODO(deploy-test-completion): Remove this suite from the deploy manifest.
// It was excluded as a known deploy failure without a documented root cause.
describe('New Link Behavior with material-ui', () => {
const { next } = nextTestSetup({
files: {
......
......@@ -3,6 +3,8 @@ import path from 'path'
const appDir = path.join(__dirname, 'stitches')
// TODO(deploy-test-completion): Remove this suite from the deploy manifest.
// It was excluded as a known deploy failure without a documented root cause.
describe('New Link Behavior with stitches', () => {
const { next } = nextTestSetup({
files: {
......
import { nextTestSetup } from 'e2e-utils'
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// This test is skipped when deployed because it asserts against runtime
// logs that cannot be queried in a deployed environment.
// @force-gate !deploy
describe('next-phase', () => {
const { next, isNextDev, skipped } = nextTestSetup({
// This test is skipped when deployed because it asserts against runtime
// logs that cannot be queried in a deployed environment.
skipDeployment: true,
const { next, isNextDev } = nextTestSetup({
files: {
'app/layout.js': `export default function Layout({ children }) {
return <html><body>{children}</body></html>
......@@ -20,8 +21,6 @@ describe('next-phase', () => {
},
})
if (skipped) return
it('should render page with next phase correctly', async () => {
await next.fetch('/')
await next.fetch('/foo')
......
import { nextTestSetup, type Playwright } from 'e2e-utils'
import { check } from 'next-test-utils'
// TODO(deploy-test-completion): Remove this suite from the deploy manifest.
// It was excluded as a known deploy failure without a documented root cause.
describe('beforeInteractive in document Head', () => {
const { next } = nextTestSetup({
files: {
......
......@@ -4,14 +4,14 @@ import { randomUUID } from 'crypto'
import fs from 'fs-extra'
import { join } from 'path'
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// It likely asserts local CLI or runtime output that deploy tests do not expose.
// @force-gate !deploy || !standaloneOutput
describe('og-api', () => {
const { next, skipped } = nextTestSetup({
const { next } = nextTestSetup({
files: new FileRef(join(__dirname, 'app')),
skipDeployment: process.env.TEST_OUTPUT_STANDALONE === 'true',
})
if (skipped) return
it('should respond from index', async () => {
const html = await renderViaHTTP(next.url, '/')
expect(html).toContain('hello world')
......
......@@ -35,21 +35,14 @@ export const config = {
}
describe('react-current-version', () => {
// This block asserts local build and server CLI output.
// @force-gate !deploy
describe('React 18 deprecation warning', () => {
const { next, isNextDeploy, skipped } = nextTestSetup({
const { next } = nextTestSetup({
files: join(__dirname, 'app'),
skipStart: true,
})
if (skipped) {
return
}
if (isNextDeploy) {
it('should skip in deploy mode', () => {})
return
}
if (isNextDev) {
it('warns during next dev only when using React 18', async () => {
await next.start()
......
import { nextTestSetup } from 'e2e-utils'
// TODO(deploy-test-completion): Remove this suite from the deploy manifest.
// It was excluded as a known deploy failure without a documented root cause.
describe('react-dnd-compile', () => {
const { next } = nextTestSetup({
files: __dirname,
......
......@@ -8,7 +8,7 @@ import {
fetchViaRawHttp,
retry,
} from 'next-test-utils'
import { nextTestSetup, isNextDev, isNextStart } from 'e2e-utils'
import { nextTestSetup, isNextDev } from 'e2e-utils'
function runTests({
next,
......@@ -421,21 +421,22 @@ function runTests({
describe('404 handling', () => {
describe('custom _error', () => {
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// It likely mutates files in the isolated local fixture after setup.
// @force-gate !deploy
describe('server mode', () => {
const { next, isNextDeploy } = nextTestSetup({
const { next } = nextTestSetup({
files: path.join(__dirname, 'app'),
skipDeployment: true,
})
if (isNextDeploy) return
runTests({ next, isDev: isNextDev, isPages404: false })
})
;(isNextStart ? describe : describe.skip)('export mode', () => {
const { next, skipped } = nextTestSetup({
// @force-gate start
describe('export mode', () => {
const { next } = nextTestSetup({
files: path.join(__dirname, 'app'),
skipStart: true,
})
if (skipped) return
let staticServer: any
let staticPort: number
......@@ -473,13 +474,14 @@ describe('404 handling', () => {
})
describe('pages/404', () => {
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// It likely mutates files in the isolated local fixture after setup.
// @force-gate !deploy
describe('server mode', () => {
const { next, skipped } = nextTestSetup({
const { next } = nextTestSetup({
files: path.join(__dirname, 'app'),
skipStart: true,
skipDeployment: true,
})
if (skipped) return
beforeAll(async () => {
await next.deleteFile('pages/_error.js')
......@@ -503,12 +505,12 @@ describe('404 handling', () => {
runTests({ next, isDev: isNextDev, isPages404: true })
})
;(isNextStart ? describe : describe.skip)('pages/404 export mode', () => {
const { next, skipped } = nextTestSetup({
// @force-gate start
describe('pages/404 export mode', () => {
const { next } = nextTestSetup({
files: path.join(__dirname, 'app'),
skipStart: true,
})
if (skipped) return
let staticServer: any
let staticPort: number
......
......@@ -3,12 +3,9 @@ import http from 'http'
import { nextTestSetup } from 'e2e-utils'
import { findPort, retry } from 'next-test-utils'
// Deploy mode exclusion: This suite opens raw TCP connections to a local backend server.
// @force-gate !deploy
describe('rewrite-request-smuggling', () => {
if ((global as any).isNextDeploy) {
it('should skip deploy', () => {})
return
}
const { next } = nextTestSetup({
files: __dirname,
skipStart: true,
......
......@@ -2,17 +2,15 @@ import { nextTestSetup } from 'e2e-utils'
import { findPort } from 'next-test-utils'
import createTargetServer from './target-server'
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// It likely depends on a local server, proxy, process, or dynamically allocated port.
// @force-gate !deploy
describe('rewrites hostname', () => {
const { skipped, next } = nextTestSetup({
const { next } = nextTestSetup({
files: __dirname,
skipDeployment: true,
skipStart: true,
})
if (skipped) {
return
}
let targetPort: number | null = null
let closeTargetServer: (() => Promise<void>) | null = null
......
import { nextTestSetup } from 'e2e-utils'
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// Pages-router `/index` route resolution differs in Vercel's deploy
// infrastructure; these assertions are local-only.
// @force-gate !deploy
describe('Route index handling', () => {
const { next } = nextTestSetup({
files: __dirname,
// Pages-router `/index` route resolution differs in Vercel's deploy
// infrastructure; these assertions are local-only.
skipDeployment: true,
})
it('should handle / correctly', async () => {
......
import { nextTestSetup } from 'e2e-utils'
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// Pages-router `/index` route resolution differs in Vercel's deploy
// infrastructure; these assertions are local-only.
// @force-gate !deploy
describe('Route indexes handling', () => {
const { next } = nextTestSetup({
files: __dirname,
// Pages-router `/index` route resolution differs in Vercel's deploy
// infrastructure; these assertions are local-only.
skipDeployment: true,
})
it('should handle / correctly', async () => {
......
......@@ -11,6 +11,8 @@ import {
import { join } from 'path'
import cheerio from 'cheerio'
// TODO(deploy-test-completion): Remove this suite from the deploy manifest.
// It was excluded as a known deploy failure without a documented root cause.
describe('skip-trailing-slash-redirect', () => {
const { next } = nextTestSetup({
files: new FileRef(join(__dirname, 'app')),
......
......@@ -28,15 +28,12 @@ async function testRoute(appPort, url, { isStatic, isEdge }) {
}
}
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// Prerenders used by this suite are not currently handled by deploy mode.
// @force-gate !deploy
describe('Switchable runtime', () => {
let context
if ((global as any).isNextDeploy) {
// TODO-APP: re-enable after Prerenders are handled on deploy
it('should skip for deploy temporarily', () => {})
return
}
const { next } = nextTestSetup({
files: new FileRef(__dirname),
})
......
import { nextTestSetup } from 'e2e-utils'
import { waitFor } from 'next-test-utils'
// TODO(deploy-test-completion): Remove this suite from the deploy manifest.
// It was excluded as a known deploy failure without a documented root cause.
describe('@next/third-parties basic usage', () => {
const { next } = nextTestSetup({
files: __dirname,
......
......@@ -2,15 +2,15 @@ import { join } from 'path'
import { nextTestSetup } from 'e2e-utils'
import { findPort, initNextServerScript, killApp } from 'next-test-utils'
// Deploy mode exclusion: This suite controls a local server or proxy process.
// Spawns a custom proxy server in front of `next.start()`; deploy mode
// doesn't run a local server.
// @force-gate !deploy
describe('Trailing Slash Rewrite Proxying', () => {
const { next, isNextDev, skipped } = nextTestSetup({
const { next, isNextDev } = nextTestSetup({
files: __dirname,
skipStart: true,
// Spawns a custom proxy server in front of `next.start()`; deploy mode
// doesn't run a local server.
skipDeployment: true,
})
if (skipped) return
let proxyServer: any
......
......@@ -2,12 +2,10 @@ import { join } from 'path'
import { FileRef, nextTestSetup } from 'e2e-utils'
import { fetchViaHTTP } from 'next-test-utils'
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// No deploy-specific incompatibility is documented.
// @force-gate !deploy
describe('trailingSlash:true with rewrites and getStaticProps', () => {
if ((global as any).isNextDeploy) {
it('should skip for deploy mode for now', () => {})
return
}
const { next } = nextTestSetup({
files: new FileRef(join(__dirname, './app')),
})
......
......@@ -8,93 +8,88 @@ import { FileRef, nextTestSetup, isNextDev } from 'e2e-utils'
import { join } from 'path'
// experimental.urlImports is not implemented in Turbopack
;(process.env.IS_TURBOPACK_TEST ? describe.skip : describe)(
`Handle url imports`,
() => {
let staticServer
let staticServerPort
beforeAll(async () => {
staticServerPort = 12345
staticServer = await startStaticServer(
join(__dirname, 'source'),
undefined,
staticServerPort
)
})
afterAll(async () => {
await stopApp(staticServer)
})
const { next, skipped } = nextTestSetup({
files: isNextDev
? {
// exclude next.lock here, should be generated automatically in dev
'next.config.js': new FileRef(join(__dirname, 'next.config.js')),
pages: new FileRef(join(__dirname, 'pages')),
public: new FileRef(join(__dirname, 'public')),
}
: __dirname,
// The staticServer above doesn't work when deployed
skipDeployment: true,
})
if (skipped) {
return
}
const expectedServer =
/Hello <!-- -->42<!-- -->\+<!-- -->42<!-- -->\+<!-- -->\/_next\/static\/(immutable\/)?media\/vercel\.[0-9a-z_-]+\.png<!-- -->\+<!-- -->\/_next\/static\/(immutable\/)?media\/vercel\.[0-9a-z_-]+\.png/
const expectedClient = new RegExp(
expectedServer.source.replace(/<!-- -->/g, '')
// Deploy mode exclusion: This suite controls a local server or proxy process.
// The staticServer above doesn't work when deployed
// @force-gate !deploy
// @force-gate !turbopack
describe(`Handle url imports`, () => {
let staticServer
let staticServerPort
beforeAll(async () => {
staticServerPort = 12345
staticServer = await startStaticServer(
join(__dirname, 'source'),
undefined,
staticServerPort
)
})
afterAll(async () => {
await stopApp(staticServer)
})
for (const page of ['/static', '/ssr', '/ssg']) {
it(`should render the ${page} page`, async () => {
const html = await next.render(page)
expect(html).toMatch(expectedServer)
})
const { next } = nextTestSetup({
files: isNextDev
? {
// exclude next.lock here, should be generated automatically in dev
'next.config.js': new FileRef(join(__dirname, 'next.config.js')),
pages: new FileRef(join(__dirname, 'pages')),
public: new FileRef(join(__dirname, 'public')),
}
: __dirname,
})
it(`should client-render the ${page} page`, async () => {
const browser = await next.browser(page)
await retry(async () =>
expect(await getBrowserBodyText(browser)).toMatch(expectedClient)
)
})
}
const expectedServer =
/Hello <!-- -->42<!-- -->\+<!-- -->42<!-- -->\+<!-- -->\/_next\/static\/(immutable\/)?media\/vercel\.[0-9a-z_-]+\.png<!-- -->\+<!-- -->\/_next\/static\/(immutable\/)?media\/vercel\.[0-9a-z_-]+\.png/
const expectedClient = new RegExp(
expectedServer.source.replace(/<!-- -->/g, '')
)
for (const page of ['/static', '/ssr', '/ssg']) {
it(`should render the ${page} page`, async () => {
const html = await next.render(page)
expect(html).toMatch(expectedServer)
})
it(`should render a static url image import`, async () => {
const browser = await next.browser('/image')
await browser.waitForElementByCss('#static-image')
it(`should client-render the ${page} page`, async () => {
const browser = await next.browser(page)
await retry(async () =>
expect(
await browser.elementByCss('#static-image').getAttribute('src')
).toMatch(
/^\/_next\/image\?url=%2F_next%2Fstatic%2F(immutable%2F)?media%2Fvercel\.[0-9a-z_-]+\.png&/
)
expect(await getBrowserBodyText(browser)).toMatch(expectedClient)
)
})
}
it(`should allow url import in css`, async () => {
const browser = await next.browser('/css')
it(`should render a static url image import`, async () => {
const browser = await next.browser('/image')
await browser.waitForElementByCss('#static-image')
await retry(async () =>
expect(
await browser.elementByCss('#static-image').getAttribute('src')
).toMatch(
/^\/_next\/image\?url=%2F_next%2Fstatic%2F(immutable%2F)?media%2Fvercel\.[0-9a-z_-]+\.png&/
)
)
})
await browser.waitForElementByCss('#static-css')
await retry(async () =>
expect(
await browser
.elementByCss('#static-css')
.getComputedCss('background-image')
).toMatch(
/^url\("http(s)?:\/\/.+\/_next\/static\/(immutable\/)?media\/vercel\.[0-9a-z_-]+\.png(?:\?.*)?"\)$/
)
it(`should allow url import in css`, async () => {
const browser = await next.browser('/css')
await browser.waitForElementByCss('#static-css')
await retry(async () =>
expect(
await browser
.elementByCss('#static-css')
.getComputedCss('background-image')
).toMatch(
/^url\("http(s)?:\/\/.+\/_next\/static\/(immutable\/)?media\/vercel\.[0-9a-z_-]+\.png(?:\?.*)?"\)$/
)
})
)
})
it('should respond on value api', async () => {
const data = await next
.fetch('/api/value')
.then((res) => res.ok && res.json())
it('should respond on value api', async () => {
const data = await next
.fetch('/api/value')
.then((res) => res.ok && res.json())
expect(data).toEqual({ value: 42 })
})
}
)
expect(data).toEqual({ value: 42 })
})
})
......@@ -10,21 +10,19 @@ import { isNextDev, isNextStart, nextTestSetup } from 'e2e-utils'
// Webpack has
// - a bug where App Router API routes (and Metadata) return client assets for `new URL`s.
// - a bug where Edge Page routes return client assets for `new URL`s.
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// No deploy-specific incompatibility is documented.
// @force-gate !deploy
describe(`Handle new URL asset references`, () => {
const { next, skipped, isTurbopack } = nextTestSetup({
const { next, isTurbopack } = nextTestSetup({
files: __dirname,
env: {
// rely on skew protection when deployed
NEXT_DEPLOYMENT_ID: isNextStart ? 'test-deployment-id' : undefined,
__NEXT_SUPPORTS_IMMUTABLE_ASSETS: isNextStart ? '1' : undefined,
},
skipDeployment: true,
})
if (skipped) {
return
}
const serverFileRegex = expect.stringMatching(
/file:.*\/.next(\/dev)?\/server\/.*\/vercel.HASH.png$/
)
......
......@@ -2,10 +2,12 @@ import { nextTestSetup } from 'e2e-utils'
import { expectVaryHeaderToContain } from 'next-test-utils'
import path from 'path'
// TODO(deploy-test-completion): Re-enable this suite in deploy mode.
// No deploy-specific incompatibility is documented.
// @force-gate !deploy
describe('Vary Header Tests', () => {
const { next } = nextTestSetup({
files: path.join(__dirname, '../app'),
skipDeployment: true,
})
it('should preserve custom vary header in API routes', async () => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment