mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
This API has experimental modes for build validation but the dev validation is going to be stable in the next release.
30 lines
875 B
TypeScript
30 lines
875 B
TypeScript
import { nextTestSetup } from 'e2e-utils'
|
|
import { retry } from 'next-test-utils'
|
|
|
|
describe('app dir - instant-validation-client', () => {
|
|
const { next, isNextDev, skipped } = nextTestSetup({
|
|
files: __dirname,
|
|
skipDeployment: true,
|
|
skipStart: true,
|
|
})
|
|
|
|
if (skipped) {
|
|
return
|
|
}
|
|
|
|
it('should error when a client component exports instant', async () => {
|
|
const expectedErrMsg = `"instant" is a route segment config and can only be used when the segment is a Server Component module. Remove the "use client" directive`
|
|
|
|
if (isNextDev) {
|
|
await next.start().catch(() => {})
|
|
await next.browser('/').catch(() => {})
|
|
await retry(async () => {
|
|
expect(next.cliOutput).toContain(expectedErrMsg)
|
|
})
|
|
} else {
|
|
const { cliOutput } = await next.build()
|
|
expect(cliOutput).toContain(expectedErrMsg)
|
|
}
|
|
})
|
|
})
|