silverwolf-x's picture
download
raw
1.06 kB
import { FileRef, nextTestSetup } from 'e2e-utils'
import { retry } from 'next-test-utils'
import path from 'path'
const envFile = '.env.development.local'
describe(`app-dir hmr-env`, () => {
const { next } = nextTestSetup({
files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')),
patchFileDelay: 1000,
})
it.each(['node', 'node-module-var', 'edge', 'edge-module-var'])(
'should update server components pages when env files is changed (%s)',
async (page) => {
const browser = await next.browser(`/env/${page}`)
expect(await browser.elementByCss('p').text()).toBe('mac')
await next.patchFile(envFile, 'MY_DEVICE="ipad"', async () => {
await retry(async () => {
expect(await browser.elementByCss('p').text()).toBe('ipad')
})
})
// ensure it's restored back to "mac" before the next test
await retry(async () => {
expect(await browser.elementByCss('p').text()).toBe('mac')
})
expect(next.cliOutput).not.toContain('FATAL')
}
)
})

Xet Storage Details

Size:
1.06 kB
·
Xet hash:
bf750145df3a7892a51dc96f806e52b2c51c2aeeac46c7ed28bd6a07ebdcb8c9

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.