Fix SyntaxError in runner.js - allow summary reassignment

This commit is contained in:
2025-12-29 10:58:14 +11:00
parent f21308cfae
commit 63032d0763

View File

@@ -157,7 +157,7 @@ async function _executeTest(url, options) {
const getScore = (cat) => (lhr.categories && lhr.categories[cat] && lhr.categories[cat].score) ? lhr.categories[cat].score * 100 : 0; const getScore = (cat) => (lhr.categories && lhr.categories[cat] && lhr.categories[cat].score) ? lhr.categories[cat].score * 100 : 0;
const getMetric = (aud) => (lhr.audits && lhr.audits[aud] && lhr.audits[aud].numericValue) ? lhr.audits[aud].numericValue : 0; const getMetric = (aud) => (lhr.audits && lhr.audits[aud] && lhr.audits[aud].numericValue) ? lhr.audits[aud].numericValue : 0;
const summary = { let summary = {
id: testId, id: testId,
url: lhr.finalUrl || url, url: lhr.finalUrl || url,
timestamp: lhr.fetchTime || new Date().toISOString(), timestamp: lhr.fetchTime || new Date().toISOString(),
@@ -223,7 +223,7 @@ async function _executeTest(url, options) {
// Use High-Res frames if available, otherwise fallback to Lighthouse thumbnails // Use High-Res frames if available, otherwise fallback to Lighthouse thumbnails
const filmstripData = (highResFrames && highResFrames.length > 5) ? highResFrames : (lhr.audits['screenshot-thumbnails']?.details?.items || []); const filmstripData = (highResFrames && highResFrames.length > 5) ? highResFrames : (lhr.audits['screenshot-thumbnails']?.details?.items || []);
const summary = { summary = {
id: testId, id: testId,
url: lhr.finalUrl || url, url: lhr.finalUrl || url,
timestamp: lhr.fetchTime || new Date().toISOString(), timestamp: lhr.fetchTime || new Date().toISOString(),