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(() =>
|
const resources = await page.evaluate(() =>
|
||||||
performance.getEntriesByType('resource')
|
performance.getEntriesByType('resource')
|
||||||
.filter(entry => /sidebar/.test(entry.name))
|
.filter(entry => /sidebar/.test(entry.name))
|
||||||
.map(entry => ({
|
.map(entry => {
|
||||||
name: entry.name.replace(/^https?:\/\/[^/]+/, ''),
|
const resource = entry as PerformanceResourceTiming
|
||||||
transferSize: entry.transferSize,
|
return {
|
||||||
decodedBodySize: entry.decodedBodySize,
|
name: entry.name.replace(/^https?:\/\/[^/]+/, ''),
|
||||||
duration: entry.duration,
|
transferSize: resource.transferSize,
|
||||||
})) as ResourceStat[],
|
decodedBodySize: resource.decodedBodySize,
|
||||||
|
duration: entry.duration,
|
||||||
|
}
|
||||||
|
}) as ResourceStat[],
|
||||||
)
|
)
|
||||||
|
|
||||||
const longtasks = probe.longtasks ?? []
|
const longtasks = probe.longtasks ?? []
|
||||||
|
|||||||
Reference in New Issue
Block a user