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

Function beforePageLoad

test/development/app-hmr/hmr.test.ts:18–25  ·  view source on GitHub ↗
(page)

Source from the content-addressed store, hash-verified

16
17 const browser = await next.browser('/does-not-exist', {
18 beforePageLoad(page) {
19 page.on('request', (request) => {
20 const url = new URL(request.url())
21 if (url.pathname === '/does-not-exist') {
22 requestCount++
23 }
24 })
25 },
26 })
27 const body = await browser.elementByCss('body').text()
28 expect(body).toContain('404')

Callers

nothing calls this directly

Calls 2

urlMethod · 0.65
onMethod · 0.45

Tested by

no test coverage detected