mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
### Why? The output layout breaks when running `next build --debug` #### Current ```sh ✓ Generating static pages (10/10) Finalizing page optimization . Collecting build traces .Redirects ┌ source: /:path+/ ├ destination: /:path+ └ permanent: true ✓ Collecting build traces ✓ Finalizing page optimization ``` #### Expected ```sh ✓ Generating static pages (4/4) Finalizing page optimization ... Collecting build traces ... Redirects ┌ source: /:path+/ ├ destination: /:path+ └ permanent: true ``` ### How? Moved the `debug` output right above the `routes` output. Also, ensured that the output layout has a consistent number of line breaks (example below marked as `>`): > Two line breaks for the next `option`, a single line break within the same content. ```sh Collecting build traces ... > > Redirects ┌ source: /:path+/ ├ destination: /:path+ └ permanent: true > ┌ source: /redirects ├ destination: / └ permanent: true > > Headers ┌ source: / └ headers: └ x-custom-headers: headers > > Rewrites ┌ source: /rewrites └ destination: / > > Route (app) Size First Load JS ┌ ○ / 141 B 86.2 kB └ ○ /_not-found 876 B 86.9 kB ``` Fixes #63192 ---------
45 lines
704 B
TypeScript
45 lines
704 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',
|
|
})
|
|
|
|
let output = ''
|
|
beforeAll(() => {
|
|
output = stripAnsi(next.cliOutput)
|
|
})
|
|
|
|
const str = `
|
|
|
|
|
|
Redirects
|
|
┌ source: /:path+/
|
|
├ destination: /:path+
|
|
└ permanent: true
|
|
|
|
┌ source: /redirects
|
|
├ destination: /
|
|
└ permanent: true
|
|
|
|
|
|
Headers
|
|
┌ source: /
|
|
└ headers:
|
|
└ x-custom-headers: headers
|
|
|
|
|
|
Rewrites
|
|
┌ source: /rewrites
|
|
└ destination: /
|
|
|
|
|
|
Route (app)`
|
|
|
|
it('should log Redirects above Route(app)', async () => {
|
|
expect(output).toContain(str)
|
|
})
|
|
})
|