From e06ce8cef1c8786fd40398577f3e7830a57b7725 Mon Sep 17 00:00:00 2001 From: Menghuan1918 Date: Tue, 1 Sep 2026 00:43:28 +0800 Subject: [PATCH] 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). --- tests/e2e/perf.e2e.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tests/e2e/perf.e2e.ts b/tests/e2e/perf.e2e.ts index d8bf184..0e90493 100644 --- a/tests/e2e/perf.e2e.ts +++ b/tests/e2e/perf.e2e.ts @@ -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 ?? []