mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
29 lines
836 B
TypeScript
29 lines
836 B
TypeScript
import { nextTestSetup } from 'e2e-utils'
|
|
import { retry } from 'next-test-utils'
|
|
|
|
describe('isolated-dev-build', () => {
|
|
const { next } = nextTestSetup({
|
|
files: __dirname,
|
|
})
|
|
|
|
it('should create dev artifacts in .next/dev/ directory', async () => {
|
|
await retry(async () => {
|
|
expect(await next.hasFile('.next/dev')).toBe(true)
|
|
expect(await next.hasFile('.next/server')).toBe(false)
|
|
})
|
|
})
|
|
|
|
it('should work with HMR', async () => {
|
|
const browser = await next.browser('/')
|
|
expect(await browser.elementByCss('p').text()).toBe('hello world')
|
|
|
|
await next.patchFile('app/page.tsx', (content) => {
|
|
return content.replace('hello world', 'hello updated world')
|
|
})
|
|
|
|
await retry(async () => {
|
|
expect(await browser.elementByCss('p').text()).toBe('hello updated world')
|
|
})
|
|
})
|
|
})
|