mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
These tests won't ever be run in a deployed environment, so this removes `skipDeployment` so it's easier to grok which tests are intentionally disabled because they don't work when deployed.
31 lines
947 B
TypeScript
31 lines
947 B
TypeScript
import { nextTestSetup } from 'e2e-utils'
|
|
|
|
describe('Edge config validations', () => {
|
|
const { next } = nextTestSetup({
|
|
skipStart: true,
|
|
files: {
|
|
'pages/index.js': `
|
|
export default function Page() {
|
|
return <p>hello world</p>
|
|
}
|
|
`,
|
|
'middleware.js': `
|
|
import { NextResponse } from 'next/server'
|
|
export default async function middleware(request) {
|
|
return NextResponse.next()
|
|
}
|
|
|
|
export const config = { unstable_allowDynamic: true }
|
|
`,
|
|
},
|
|
})
|
|
|
|
it('fails to build when unstable_allowDynamic is not a string', async () => {
|
|
const res = await next.build()
|
|
expect(res.exitCode).toBe(1)
|
|
expect(res.cliOutput).toContain(
|
|
'middleware contains invalid middleware config: Expected string, received boolean at "unstable_allowDynamic", or Expected array, received boolean at "unstable_allowDynamic"'
|
|
)
|
|
})
|
|
})
|