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:
@@ -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 ?? []
|
||||
|
||||
Reference in New Issue
Block a user