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

Function getSrc

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

Source from the content-addressed store, hash-verified

58}
59
60async function getSrc(browser, id) {
61 const src = await browser.elementById(id).getAttribute('src')
62 if (src) {
63 const url = new URL(src, `http://localhost:${appPort}`)
64 return url.href.slice(url.origin.length)
65 }
66}
67
68function getRatio(width, height) {
69 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