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

Method eval

test/lib/browsers/playwright.ts:582–598  ·  view source on GitHub ↗
(
    fn: string | ((...args: any[]) => any),
    ...args: any[]
  )

Source from the content-addressed store, hash-verified

580 ...args: any[]
581 ): Playwright<T> & Promise<T>
582 eval(
583 fn: string | ((...args: any[]) => any),
584 ...args: any[]
585 ): Playwright<any> & Promise<any> {
586 return this.startChain(async () =>
587 page
588 .evaluate(fn, ...args)
589 .catch((err) => {
590 // TODO: gross, why are we doing this
591 console.error('eval error:', err)
592 return null!
593 })
594 .finally(async () => {
595 await page.waitForLoadState()
596 })
597 )
598 }
599
600 async log<T extends boolean = false>(options?: { includeArgs?: T }) {
601 return this.startChain(

Callers 15

runTestsFunction · 0.80
index.test.tsFile · 0.80
goFromHomeToAnotherFunction · 0.80
goFromAnotherToHomeFunction · 0.80
navigateTestFunction · 0.80
index.test.tsFile · 0.80
getCacheKeysFunction · 0.80
runTestsFunction · 0.80
index.test.tsFile · 0.80
index.test.tsFile · 0.80
getComputedFunction · 0.80

Calls 5

startChainMethod · 0.95
finallyMethod · 0.80
errorMethod · 0.65
catchMethod · 0.45
evaluateMethod · 0.45

Tested by 15

runTestsFunction · 0.64
goFromHomeToAnotherFunction · 0.64
goFromAnotherToHomeFunction · 0.64
navigateTestFunction · 0.64
getCacheKeysFunction · 0.64
runTestsFunction · 0.64
getComputedFunction · 0.64
getComputedStyleFunction · 0.64
runTestsFunction · 0.64
runTestsFunction · 0.64
lazyLoadingTestsFunction · 0.64
getComputedFunction · 0.64