MCPcopy
hub / github.com/nuxt/nuxt / expectNoClientErrors

Function expectNoClientErrors

test/utils.ts:52–64  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

50}
51
52export async function expectNoClientErrors (path: string) {
53 const ctx = useTestContext()
54 if (!ctx.options.browser) {
55 return
56 }
57
58 const { page, pageErrors, consoleLogs } = (await renderPage(path))!
59
60 expect(pageErrors).toEqual([])
61 expectNoErrorsOrWarnings(consoleLogs)
62
63 await page.close()
64}
65
66export function expectNoErrorsOrWarnings (consoleLogs: Array<{ type: string, text: string }>) {
67 const consoleLogErrors = consoleLogs.filter(i => i.type === 'error')

Callers 1

basic.test.tsFile · 0.90

Calls 2

renderPageFunction · 0.85
expectNoErrorsOrWarningsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…