mirror of
https://github.com/vercel/next.js.git
synced 2026-09-20 02:25:18 +08:00
e0966df114
## Summary - migrate Cache Components, PPR, prefetching, prerendering, revalidation, and SSG deployment exclusions to `@force-gate` - remove the corresponding `skipDeployment` options and `skipped` control flow while preserving each suite's rationale This keeps caching-related exclusions together so their deployed semantics can be reviewed by the same owners. ## Verification - verified on the combined top-of-stack tree with `pnpm typescript` - compared ordinary-mode collection before and after: all 4,670 existing test names matched - collected all 510 affected files in deploy mode: 4,578 skipped tests, zero failures <!-- NEXT_JS_LLM -->
62 lines
1.9 KiB
TypeScript
62 lines
1.9 KiB
TypeScript
import { nextTestSetup } from 'e2e-utils'
|
|
|
|
// TODO(NAR-423): Migrate to Cache Components.
|
|
// 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. This is also intended to be used in development.
|
|
// @force-gate !deploy
|
|
// @force-gate TODO
|
|
describe('static-shell-debugging', () => {
|
|
const cacheComponents = Boolean(process.env.__NEXT_CACHE_COMPONENTS)
|
|
const context = {
|
|
cacheComponents,
|
|
debugging: cacheComponents,
|
|
}
|
|
|
|
const { next, isNextDev } = nextTestSetup({
|
|
files: __dirname,
|
|
env: {
|
|
__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING: context.debugging
|
|
? '1'
|
|
: undefined,
|
|
},
|
|
nextConfig: {
|
|
cacheComponents: context.cacheComponents,
|
|
},
|
|
})
|
|
|
|
if (context.debugging && context.cacheComponents) {
|
|
it('should only render the static shell', async () => {
|
|
const res = await next.fetch('/?__nextppronly=1')
|
|
expect(res.status).toBe(200)
|
|
|
|
const html = await res.text()
|
|
expect(html).toContain('Fallback')
|
|
expect(html).not.toContain('Dynamic')
|
|
})
|
|
|
|
// The __nextppronly query param is currently only supported in dev mode.
|
|
if (isNextDev) {
|
|
it('should skip hydration to avoid blanking out the page', async () => {
|
|
const browser = await next.browser('/?__nextppronly=1', {
|
|
waitHydration: false,
|
|
})
|
|
|
|
expect(await browser.elementByCss('div').text()).toBe('Fallback')
|
|
|
|
// Must not log the page error "Error: Connection closed."
|
|
expect(await browser.log()).toEqual([])
|
|
})
|
|
}
|
|
} else {
|
|
it('should render the full page', async () => {
|
|
const res = await next.fetch('/?__nextppronly=1')
|
|
expect(res.status).toBe(200)
|
|
|
|
const html = await res.text()
|
|
expect(html).toContain('Fallback')
|
|
expect(html).toContain('Dynamic')
|
|
})
|
|
}
|
|
})
|