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.
27 lines
750 B
TypeScript
27 lines
750 B
TypeScript
import { nextTestSetup } from 'e2e-utils'
|
|
import fsp from 'fs/promises'
|
|
import path from 'path'
|
|
|
|
describe('500-page - mixed-router-with-custom-pages-error', () => {
|
|
const { next, skipped } = nextTestSetup({
|
|
files: __dirname,
|
|
})
|
|
|
|
if (skipped) {
|
|
return
|
|
}
|
|
|
|
it('should not override 500.html with app router global-error when pages _error.tsx exists', async () => {
|
|
const $ = await next.render$('/pages-error')
|
|
expect($('#__next').text()).toBe('pages-custom-error')
|
|
})
|
|
|
|
it('should generate 500.html with pages builtin _error', async () => {
|
|
const html = await fsp.readFile(
|
|
path.join(next.testDir, '.next', 'server', 'pages', '500.html'),
|
|
'utf8'
|
|
)
|
|
expect(html).toContain('pages-custom-error')
|
|
})
|
|
})
|