mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
Fixes failing assertion with turbopack Verified against turbopack + adapter deploy test locally <img width="2076" height="1336" alt="CleanShot 2026-02-26 at 13 25 30@2x" src="https://github.com/user-attachments/assets/a8c66314-8163-4371-b02a-dc7146989425" /> x-ref: https://github.com/vercel/next.js/pull/90600#issuecomment-3968044160
42 lines
1.2 KiB
TypeScript
42 lines
1.2 KiB
TypeScript
import { nextTestSetup, FileRef } from 'e2e-utils'
|
|
import { join } from 'path'
|
|
|
|
// x-ref: https://github.com/vercel/next.js/issues/45189
|
|
describe('edge render - custom _document with edge runtime', () => {
|
|
const { next } = nextTestSetup({
|
|
files: {
|
|
'pages/index.js': new FileRef(
|
|
join(__dirname, 'app', 'pages', 'index.js')
|
|
),
|
|
'pages/[id].js': new FileRef(join(__dirname, 'app', 'pages', '[id].js')),
|
|
'next.config.js': new FileRef(join(__dirname, 'app', 'next.config.js')),
|
|
'my-adapter.js': new FileRef(join(__dirname, 'app', 'my-adapter.js')),
|
|
'pages/_document.js': `
|
|
import Document, { Html, Head, Main, NextScript } from 'next/document'
|
|
export default class MyDocument extends Document {
|
|
render() {
|
|
return (
|
|
<Html>
|
|
<Head />
|
|
<body>
|
|
<Main />
|
|
<NextScript />
|
|
</body>
|
|
</Html>
|
|
)
|
|
}
|
|
}
|
|
|
|
export const config = {
|
|
runtime: 'experimental-edge',
|
|
}
|
|
`,
|
|
},
|
|
})
|
|
|
|
it('should render page properly', async () => {
|
|
const $ = await next.render$('/')
|
|
expect($('#page').text()).toBe('/index')
|
|
})
|
|
})
|