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

Function getComputed

test/integration/next-image-legacy/default/test/index.test.ts:39–52  ·  view source on GitHub ↗
(browser, id, prop)

Source from the content-addressed store, hash-verified

37 )
38}
39async function getComputed(browser, id, prop) {
40 const val = await browser.eval(`document.getElementById('${id}').${prop}`)
41 if (typeof val === 'number') {
42 return val
43 }
44 if (typeof val === 'string') {
45 const v = parseInt(val, 10)
46 if (isNaN(v)) {
47 return val
48 }
49 return v
50 }
51 return null
52}
53
54async function getComputedStyle(browser, id, prop) {
55 return browser.eval(

Callers 1

runTestsFunction · 0.70

Calls 3

evalMethod · 0.80
parseIntFunction · 0.50
isNaNFunction · 0.50

Tested by

no test coverage detected