mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
39 lines
1.2 KiB
TypeScript
39 lines
1.2 KiB
TypeScript
import { nextTestSetup } from 'e2e-utils'
|
|
import { waitForRedbox, waitForNoRedbox } from 'next-test-utils'
|
|
|
|
describe('develop - app-dir - edge errros hmr', () => {
|
|
const { next } = nextTestSetup({
|
|
files: __dirname,
|
|
})
|
|
|
|
it('should recover from build errors when server component error', async () => {
|
|
const browser = await next.browser('/')
|
|
const clientComponentSource = await next.readFile('app/comp.server.js')
|
|
|
|
await next.patchFile('app/comp.server.js', (content) => {
|
|
return content.replace('{/* < */}', '<') // uncomment
|
|
})
|
|
|
|
await waitForRedbox(browser)
|
|
|
|
await next.patchFile('app/comp.server.js', clientComponentSource)
|
|
|
|
await waitForNoRedbox(browser)
|
|
})
|
|
|
|
it('should recover from build errors when client component error', async () => {
|
|
const browser = await next.browser('/')
|
|
const clientComponentSource = await next.readFile('app/comp.client.js')
|
|
|
|
await next.patchFile('app/comp.client.js', (content) => {
|
|
return content.replace('{/* < */}', '<') // uncomment
|
|
})
|
|
|
|
await waitForRedbox(browser)
|
|
|
|
await next.patchFile('app/comp.client.js', clientComponentSource)
|
|
|
|
await waitForNoRedbox(browser)
|
|
})
|
|
})
|