Skip to content

Commit

Permalink
LH 3.0 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ebidel committed Jun 29, 2018
1 parent e529acb commit 9fe465c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 1 addition & 2 deletions builder/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
Expand Down
8 changes: 5 additions & 3 deletions frontend/lighthouse-ci.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down Expand Up @@ -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 = `
Expand Down

0 comments on commit 9fe465c

Please sign in to comment.