silverwolf-x's picture
download
raw
1.11 kB
import { nextTestSetup } from 'e2e-utils'
import { retry } from 'next-test-utils'
describe('browser-log-forwarding warn level', () => {
const { next } = nextTestSetup({
files: __dirname,
})
it('should forward warn and error logs to terminal', async () => {
const outputIndex = next.cliOutput.length
await next.browser('/')
await retry(() => {
const output = next.cliOutput.slice(outputIndex)
expect(output).toContain('browser error:')
expect(output).toContain('browser warn:')
})
// Get final output after logs are forwarded
const output = next.cliOutput.slice(outputIndex)
// Filter to only browser forwarded logs, excluding hydration noise
const browserLogs = output
.split('\n')
.filter(
(line) =>
line.includes('[browser]') &&
!line.includes('Next.js hydrate callback fire')
)
.join('\n')
expect(browserLogs).toMatchInlineSnapshot(`
"[browser] browser warn: this is a warning message (app/page.tsx:9:13)
[browser] browser error: this is an error message "
`)
})
})

Xet Storage Details

Size:
1.11 kB
·
Xet hash:
6b16547adbc5860fbb0f83f7fcb43675526b109279cb6041c37c3920f645d9a0

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.