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

Function hasAnotherScript

test/integration/preload-viewport/test/index.test.ts:314–328  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

312 })
313
314 async function hasAnotherScript() {
315 const scripts = await browser.elementsByCss(
316 // Mouse hover is a high-priority fetch
317 'script:not([async])'
318 )
319 let scriptFound = false
320 for (const aScript of scripts) {
321 const href = await aScript.getAttribute('src')
322 if (href.includes(chunkAnother)) {
323 scriptFound = true
324 break
325 }
326 }
327 return scriptFound
328 }
329
330 expect(await hasAnotherScript()).toBe(false)
331 await browser.elementByCss('#link-another').moveTo()

Callers 1

index.test.tsFile · 0.85

Calls 3

elementsByCssMethod · 0.80
getAttributeMethod · 0.80
includesMethod · 0.80

Tested by

no test coverage detected