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

Function getSrc

test/integration/next-image-legacy/base-path/test/index.test.ts:50–56  ·  view source on GitHub ↗
(browser, id)

Source from the content-addressed store, hash-verified

48}
49
50async function getSrc(browser, id) {
51 const src = await browser.elementById(id).getAttribute('src')
52 if (src) {
53 const url = new URL(src, `http://localhost:${appPort}`)
54 return url.href.slice(url.origin.length)
55 }
56}
57
58function getRatio(width, height) {
59 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