Files
Niklas MischkulnigandGitHub 02af7ed3a4 test: Improve test assertions to prepare for dpl query string (#90463)
*This doesn't enable skew protection for any new tests, only preparation*

Prepare a lot of test assertions so that they work correctly when a `?dpl=123` query param is present:
- some regexes should accept the query
- some places assumed that the `<script>`'s `src` is a valid pathname, whereas it might have a query param that has to be stripped before removing the path
- some hardcoded build ids instead of `next.buildId`
2026-02-25 12:16:10 +01:00

28 lines
697 B
TypeScript

import { nextTestSetup } from 'e2e-utils'
import stripAnsi from 'strip-ansi'
describe('next build --debug', () => {
const { next } = nextTestSetup({
files: __dirname,
buildCommand: 'pnpm next build --debug',
})
it('should log Redirects above Route(app)', async () => {
const output = stripAnsi(next.cliOutput)
const redirectsIndex = output.indexOf(`Redirects
┌ source: /:path+/
├ destination: /:path+
└ permanent: true`)
const routeAppIndex = output.indexOf(`Route (app)
┌ ○ /
└ ○ /_not-found`)
expect(redirectsIndex).toBeGreaterThan(-1)
expect(routeAppIndex).toBeGreaterThan(-1)
expect(redirectsIndex).toBeLessThan(routeAppIndex)
})
})