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

Function getSrc

test/integration/next-image-new/default/test/index.test.ts:65–71  ·  view source on GitHub ↗
(browser, id)

Source from the content-addressed store, hash-verified

63}
64
65async function getSrc(browser, id) {
66 const src = await browser.elementById(id).getAttribute('src')
67 if (src) {
68 const url = new URL(src, `http://localhost:${appPort}`)
69 return url.href.slice(url.origin.length)
70 }
71}
72
73function getRatio(width, height) {
74 return height / width

Callers 1

runTestsFunction · 0.70

Calls 3

getAttributeMethod · 0.80
elementByIdMethod · 0.80
sliceMethod · 0.45

Tested by

no test coverage detected