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

Function hasSsgScript

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

Source from the content-addressed store, hash-verified

346 '/ssg/basic'
347 )
348 async function hasSsgScript() {
349 const scripts = await browser.elementsByCss(
350 // Mouse hover is a high-priority fetch
351 'script:not([async])'
352 )
353 let scriptFound = false
354 for (const aScript of scripts) {
355 const href = await aScript.getAttribute('src')
356 if (href.includes(chunkBasic)) {
357 scriptFound = true
358 break
359 }
360 }
361 return scriptFound
362 }
363
364 await waitFor(2 * 1000)
365 expect(await hasSsgScript()).toBe(false)

Callers 1

index.test.tsFile · 0.85

Calls 3

elementsByCssMethod · 0.80
getAttributeMethod · 0.80
includesMethod · 0.80

Tested by

no test coverage detected