mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
1. Align the code highlight marker color with the issue severity 2. Make the issue title colored 3. Prefix issues with `Warning` or `Error` <img width="1383" height="862" alt="Bildschirmfoto 2026-06-16 um 18 59 03" src="https://github.com/user-attachments/assets/f98c606d-4ea8-40c2-836d-e395f1df904c" /> <img width="1039" height="450" alt="Bildschirmfoto 2026-06-16 um 19 03 39" src="https://github.com/user-attachments/assets/2747f914-0587-4178-a87d-344f24715c96" /> <details> <summary>Old</summary> <img width="1267" height="745" alt="Bildschirmfoto 2026-06-16 um 17 04 35" src="https://github.com/user-attachments/assets/837739ff-82f7-4ea2-8767-ca7d866a8570" /> </details>
37 lines
1.2 KiB
TypeScript
37 lines
1.2 KiB
TypeScript
import { FileRef, nextTestSetup } from 'e2e-utils'
|
||
import { waitForRedbox, getRedboxSource } from 'next-test-utils'
|
||
import { join } from 'path'
|
||
|
||
describe('font-loader-in-document-error', () => {
|
||
const { next } = nextTestSetup({
|
||
files: {
|
||
pages: new FileRef(join(__dirname, 'font-loader-in-document/pages')),
|
||
},
|
||
})
|
||
|
||
test('next/font inside _document', async () => {
|
||
const browser = await next.browser('/')
|
||
await waitForRedbox(browser)
|
||
if (process.env.IS_TURBOPACK_TEST) {
|
||
// TODO: Turbopack doesn't include pages/
|
||
expect(await getRedboxSource(browser)).toMatchInlineSnapshot(`
|
||
"./_document.js
|
||
Error: next/font: error:
|
||
Cannot be used within _document.js"
|
||
`)
|
||
} else if (process.env.NEXT_RSPACK) {
|
||
expect(await getRedboxSource(browser)).toMatchInlineSnapshot(`
|
||
"pages/_document.js
|
||
× \`next/font\` error:
|
||
│ Cannot be used within pages/_document.js."
|
||
`)
|
||
} else {
|
||
expect(await getRedboxSource(browser)).toMatchInlineSnapshot(`
|
||
"pages/_document.js
|
||
\`next/font\` error:
|
||
Cannot be used within pages/_document.js."
|
||
`)
|
||
}
|
||
})
|
||
})
|