Files
Zack TannerandGitHub e296bcb812 [tests]: remove unnecessary skipDeployment flags (#92423)
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.
2026-04-06 14:30:07 -07:00

35 lines
1.0 KiB
TypeScript

import { nextTestSetup } from 'e2e-utils'
describe('config validation - fatal errors', () => {
const { next } = nextTestSetup({
skipStart: true,
files: __dirname,
})
it('should show warnings first, then throw fatal error', async () => {
const { exitCode, cliOutput } = await next.build()
// Build should fail
expect(exitCode).toBe(1)
// Should show warnings first
expect(cliOutput).toContain('Invalid next.config.js options detected')
expect(cliOutput).toContain(
"Unrecognized key(s) in object: 'unknownExperimentalOption', 'anotherUnknownOption'"
)
expect(cliOutput).toContain('at "experimental"')
// Should show fatal error
expect(cliOutput).toContain(
'Fatal next config errors found in next.config.js that must be fixed'
)
expect(cliOutput).toContain(
"Unrecognized key(s) in object: 'invalidOption'"
)
expect(cliOutput).toContain('at "images"')
expect(cliOutput).toContain(
'These configuration options are required or have been migrated'
)
})
})