mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
These tests won't ever be run in a deployed environment, so this removes `skipDeployment` so it's easier to grok which tests are intentionally disabled because they don't work when deployed.
44 lines
1.2 KiB
TypeScript
44 lines
1.2 KiB
TypeScript
import { nextTestSetup } from 'e2e-utils'
|
|
|
|
// TODO: the incremental option has been removed, update to use cacheComponents
|
|
describe.skip('app-dir - metadata-streaming-config-customized', () => {
|
|
const { next } = nextTestSetup({
|
|
files: __dirname,
|
|
overrideFiles: {
|
|
'next.config.js': `
|
|
module.exports = {
|
|
htmlLimitedBots: /MyBot/i,
|
|
experimental: {
|
|
ppr: 'incremental',
|
|
}
|
|
}
|
|
`,
|
|
},
|
|
})
|
|
|
|
it('should have the customized streaming metadata config output in routes-manifest.json', async () => {
|
|
const prerenderManifest = JSON.parse(
|
|
await next.readFile('.next/prerender-manifest.json')
|
|
)
|
|
const { routes } = prerenderManifest
|
|
|
|
const bypassConfigs = Object.keys(routes)
|
|
.map((route) => [route, routes[route].experimentalBypassFor?.[2]])
|
|
.filter(([, bypassConfig]) => Boolean(bypassConfig))
|
|
.reduce((acc, [route, bypassConfig]) => {
|
|
acc[route] = bypassConfig
|
|
return acc
|
|
}, {})
|
|
|
|
expect(bypassConfigs).toMatchInlineSnapshot(`
|
|
{
|
|
"/ppr": {
|
|
"key": "user-agent",
|
|
"type": "header",
|
|
"value": "MyBot",
|
|
},
|
|
}
|
|
`)
|
|
})
|
|
})
|