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

65 lines
1.9 KiB
TypeScript

import { nextTestSetup } from 'e2e-utils'
import { retry } from 'next-test-utils'
import stripAnsi from 'strip-ansi'
// turbopack.ignoreIssue only works with Turbopack
;(process.env.IS_TURBOPACK_TEST ? describe : describe.skip)(
'css-parse-error-recovery',
() => {
describe('with turbopack.ignoreIssue config', () => {
const { next, skipped } = nextTestSetup({
files: __dirname,
nextConfig: {
turbopack: {
ignoreIssue: [
{
path: '**/css-error/**',
},
],
},
},
})
if (skipped) return
it('should render page with ignored CSS parse error', async () => {
const res = await next.fetch('/css-error')
expect(res.status).toBe(200)
const html = await res.text()
expect(html).toContain('css error page')
})
it('should suppress CSS parse error from cli output when ignored', async () => {
const outputIndex = next.cliOutput.length
await next.fetch('/css-error')
await retry(async () => {
const output = stripAnsi(next.cliOutput.slice(outputIndex))
expect(output).toContain('GET /css-error')
})
const output = stripAnsi(next.cliOutput.slice(outputIndex))
expect(output).not.toContain('Parsing CSS source code failed')
})
})
describe('without turbopack.ignoreIssue config', () => {
const { next, skipped } = nextTestSetup({
files: __dirname,
})
if (skipped) return
it('should show CSS parse error in cli output when not ignored', async () => {
const outputIndex = next.cliOutput.length
await next.fetch('/css-error')
await retry(async () => {
const output = stripAnsi(next.cliOutput.slice(outputIndex))
expect(output).toContain('Parsing CSS source code failed')
})
})
})
}
)