mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +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.
35 lines
1.0 KiB
TypeScript
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'
|
|
)
|
|
})
|
|
})
|