(isPages404)
| 412 | |
| 413 | describe('404 handling', () => { |
| 414 | const devStartAndExport = (isPages404) => { |
| 415 | describe('next dev', () => { |
| 416 | beforeAll(async () => { |
| 417 | appPort = await findPort() |
| 418 | app = await launchApp(appDir, appPort) |
| 419 | |
| 420 | // prebuild pages |
| 421 | await renderViaHTTP(appPort, '/') |
| 422 | await renderViaHTTP(appPort, '/another') |
| 423 | }) |
| 424 | afterAll(() => killApp(app)) |
| 425 | |
| 426 | runTests({ |
| 427 | isPages404, |
| 428 | isDev: true, |
| 429 | }) |
| 430 | }) |
| 431 | ;(process.env.TURBOPACK_DEV ? describe.skip : describe)( |
| 432 | 'production mode', |
| 433 | () => { |
| 434 | describe('next start', () => { |
| 435 | beforeAll(async () => { |
| 436 | await nextBuild(appDir) |
| 437 | appPort = await findPort() |
| 438 | app = await nextStart(appDir, appPort) |
| 439 | }) |
| 440 | afterAll(() => killApp(app)) |
| 441 | runTests({ |
| 442 | isPages404, |
| 443 | }) |
| 444 | }) |
| 445 | describe('next export', () => { |
| 446 | beforeAll(async () => { |
| 447 | nextConfig.write(`module.exports = { output: 'export' }`) |
| 448 | await nextBuild(appDir) |
| 449 | app = await startStaticServer(outdir, join(outdir, '404.html')) |
| 450 | appPort = app.address().port |
| 451 | }) |
| 452 | afterAll(async () => { |
| 453 | await stopApp(app) |
| 454 | nextConfig.restore() |
| 455 | }) |
| 456 | runTests({ |
| 457 | isPages404, |
| 458 | isExport: true, |
| 459 | }) |
| 460 | }) |
| 461 | } |
| 462 | ) |
| 463 | } |
| 464 | |
| 465 | describe('custom _error', () => { |
| 466 | devStartAndExport(false) |
no test coverage detected