diff --git a/builder/server.js b/builder/server.js index d1d9868..f2c55a3 100644 --- a/builder/server.js +++ b/builder/server.js @@ -133,8 +133,7 @@ app.get('/ci', (req, res, next) => { const apiKey = req.query.key; // Require API for get requests. if (!apiKey) { - const msg = `Missing API key. Please include the key parameter`; - res.status(403).send(`Missing API key. Please include the key parameter`); + res.status(403).send('Missing API key. Please include the key parameter'); return; } console.log(`${API_KEY_HEADER}: ${apiKey}`); diff --git a/frontend/lighthouse-ci.js b/frontend/lighthouse-ci.js index 0292b27..dab9f11 100644 --- a/frontend/lighthouse-ci.js +++ b/frontend/lighthouse-ci.js @@ -94,7 +94,9 @@ class LighthouseCI { * @return {!number} */ static getOverallScore(lhResults) { - return lhResults.score; + // Note: LH 2.9 returned just PWA score for overall score. Keep those + // semantics for now. + return lhResults.categories.pwa.score * 100; } /** @@ -145,8 +147,8 @@ class LighthouseCI { */ postLighthouseComment(prInfo, lhResults) { let rows = ''; - lhResults.reportCategories.forEach(cat => { - rows += `| ${cat.name} | ${Math.round(cat.score)} |\n`; + Object.values(lhResults.categories).forEach(cat => { + rows += `| ${cat.title} | ${Math.round(cat.score)} |\n`; }); const body = `