mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
*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`
28 lines
697 B
TypeScript
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)
|
|
})
|
|
})
|