mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-20 06:20:11 +00:00
debug: add coverage collection logging to diagnose 0/0 coverage
This commit is contained in:
@@ -420,14 +420,42 @@ export const comfyPageFixture = base.extend<{
|
||||
await use(page)
|
||||
const entries = await page.coverage.stopJSCoverage()
|
||||
|
||||
// Debug: log coverage entry stats
|
||||
const httpEntries = entries.filter((e) => e.url.startsWith('http'))
|
||||
const withSource = entries.filter(
|
||||
(e) => typeof e.source === 'string'
|
||||
).length
|
||||
console.log(
|
||||
`[coverage] ${testInfo.title}: ${entries.length} entries, ${httpEntries.length} HTTP, ${withSource} with source`
|
||||
)
|
||||
if (httpEntries.length > 0) {
|
||||
console.log(
|
||||
`[coverage] Sample URLs: ${httpEntries
|
||||
.slice(0, 3)
|
||||
.map((e) => e.url)
|
||||
.join(', ')}`
|
||||
)
|
||||
}
|
||||
|
||||
let fetchedCount = 0
|
||||
for (const entry of entries) {
|
||||
if (typeof entry.source !== 'string' && entry.url.startsWith('http')) {
|
||||
try {
|
||||
const resp = await fetch(entry.url)
|
||||
if (resp.ok) (entry as Record<string, unknown>).source = await resp.text()
|
||||
} catch {}
|
||||
if (resp.ok) {
|
||||
;(entry as Record<string, unknown>).source = await resp.text()
|
||||
fetchedCount++
|
||||
} else {
|
||||
console.log(
|
||||
`[coverage] fetch failed ${entry.url}: ${resp.status}`
|
||||
)
|
||||
}
|
||||
} catch (err) {
|
||||
console.log(`[coverage] fetch error ${entry.url}: ${err}`)
|
||||
}
|
||||
}
|
||||
}
|
||||
console.log(`[coverage] Fetched sources for ${fetchedCount} scripts`)
|
||||
|
||||
const resultFile = testInfo.outputPath('v8-coverage.json')
|
||||
await fs.writeFile(resultFile, JSON.stringify({ result: entries }))
|
||||
|
||||
Reference in New Issue
Block a user