test: fix the perf lane's resource typing for typecheck

getEntriesByType widens to PerformanceEntry; transferSize/
decodedBodySize live on PerformanceResourceTiming (the e2e specs sit
outside tsconfig.build.json, so the bundler never saw this).
This commit is contained in:
Menghuan1918
2026-09-01 16:07:33 +08:00
parent 8a01e5d881
commit e06ce8cef1
+9 -6
View File
@@ -149,12 +149,15 @@ test('measure: mount latency, longtasks and bundle cost through a full tab sweep
const resources = await page.evaluate(() =>
performance.getEntriesByType('resource')
.filter(entry => /sidebar/.test(entry.name))
.map(entry => ({
name: entry.name.replace(/^https?:\/\/[^/]+/, ''),
transferSize: entry.transferSize,
decodedBodySize: entry.decodedBodySize,
duration: entry.duration,
})) as ResourceStat[],
.map(entry => {
const resource = entry as PerformanceResourceTiming
return {
name: entry.name.replace(/^https?:\/\/[^/]+/, ''),
transferSize: resource.transferSize,
decodedBodySize: resource.decodedBodySize,
duration: entry.duration,
}
}) as ResourceStat[],
)
const longtasks = probe.longtasks ?? []