MCPcopy
hub / github.com/vercel/next.js / assertNoConsoleErrors

Function assertNoConsoleErrors

test/lib/next-test-utils.ts:1947–1961  ·  view source on GitHub ↗
(browser: Playwright)

Source from the content-addressed store, hash-verified

1945}
1946
1947export async function assertNoConsoleErrors(browser: Playwright) {
1948 const logs = await browser.log()
1949 const warningsAndErrors = logs.filter((log) => {
1950 return (
1951 log.source === 'warning' ||
1952 (log.source === 'error' &&
1953 // These are expected when we visit 404 pages.
1954 !log.message.startsWith(
1955 'Failed to load resource: the server responded with a status of 404'
1956 ))
1957 )
1958 })
1959
1960 expect(warningsAndErrors).toEqual([])
1961}
1962
1963export async function getHighlightedDiffLines(
1964 browser: Playwright

Calls 4

startsWithMethod · 0.80
expectFunction · 0.50
logMethod · 0.45
filterMethod · 0.45

Tested by 1

waitForScrollToCompleteFunction · 0.72