feat: integrate Lighthouse in MobilePerformanceMonitor

This commit is contained in:
张翔 committed 2026-03-05 15:15:22 +08:00
1 parent 8194317a20
commit 06c5fe8f82
4 files changed
+2552

No files matched your search

@@ -12,4 +12,14 @@ test.describe('MobilePerformanceMonitor', () => {
expect(vitals.LCP).toBeGreaterThan(0);
expect(vitals.CLS).toBeGreaterThanOrEqual(0);
});
test('should run Lighthouse audit', async ({ page }) => {
await page.goto('/');
const monitor = new MobilePerformanceMonitor(page);
const result = await monitor.runLighthouseAudit(page.url());
expect(result.score).toBeGreaterThan(0);
expect(result.audits).toBeDefined();
});
});