build(docs-infra): update Lighthouse to version 7.2.0 (#40994)

In this version, we no longer need our custom logic to skip certain
HTTPS related audits on localhost, since Lighthouse will treat it as a
secure context (similar to how browsers do).
See also GoogleChrome/lighthouse#11766.

PR Close #40994
This commit is contained in:
George Kalpakas 2021-03-01 13:22:13 +02:00 committed by Zach Arend
parent 10aa5641dd
commit 6e40551394
3 changed files with 10 additions and 21 deletions

View File

@ -147,7 +147,7 @@
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.5.0",
"light-server": "^2.6.2",
"lighthouse": "^7.0.0",
"lighthouse": "^7.2.0",
"lighthouse-logger": "^1.2.0",
"lodash": "^4.17.4",
"lunr": "^2.1.0",

View File

@ -35,7 +35,6 @@ const puppeteer = require('puppeteer');
// Constants
const AUDIT_CATEGORIES = ['accessibility', 'best-practices', 'performance', 'pwa', 'seo'];
const LIGHTHOUSE_FLAGS = {logLevel: process.env.CI ? 'error' : 'info'}; // Be less verbose on CI.
const SKIPPED_HTTPS_AUDITS = ['redirects-http', 'uses-http2'];
const VIEWER_URL = 'https://googlechrome.github.io/lighthouse/viewer';
const WAIT_FOR_SW_DELAY = 5000;
@ -45,7 +44,6 @@ _main(process.argv.slice(2));
// Functions - Definitions
async function _main(args) {
const {url, minScores, logFile} = parseInput(args);
const isOnHttp = /^http:/.test(url);
const lhFlags = {...LIGHTHOUSE_FLAGS, onlyCategories: Object.keys(minScores).sort()};
const lhConfig = {
extends: 'lighthouse:default',
@ -57,10 +55,6 @@ async function _main(args) {
console.log(`Running web-app audits for '${url}'...`);
console.log(` Audit categories: ${lhFlags.onlyCategories.join(', ')}`);
// If testing on HTTP, skip HTTPS-specific tests.
// (Note: Browsers special-case localhost and run ServiceWorker even on HTTP.)
if (isOnHttp) skipHttpsAudits(lhConfig);
logger.setLevel(lhFlags.logLevel);
try {
@ -171,8 +165,3 @@ async function processResults(results, minScores, logFile) {
return success;
}
function skipHttpsAudits(config) {
console.log(` Skipping HTTPS-related audits: ${SKIPPED_HTTPS_AUDITS.join(', ')}`);
config.settings = {...config.settings, skipAudits: SKIPPED_HTTPS_AUDITS};
}

View File

@ -2520,10 +2520,10 @@ aws4@^1.8.0:
resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.9.1.tgz#7e33d8f7d449b3f673cd72deb9abdc552dbe528e"
integrity sha512-wMHVg2EOHaMRxbzgFJ9gtjOOCrI80OHLG14rxi28XwOW8ux6IiEbRCGGGqCtdAIg4FQCbW20k9RsT4y3gJlFug==
axe-core@4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.1.1.tgz#70a7855888e287f7add66002211a423937063eaf"
integrity sha512-5Kgy8Cz6LPC9DJcNb3yjAXTu3XihQgEdnIg50c//zOC/MyLP0Clg+Y8Sh9ZjjnvBrDZU4DgXS9C3T9r4/scGZQ==
axe-core@4.1.2:
version "4.1.2"
resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.1.2.tgz#7cf783331320098bfbef620df3b3c770147bc224"
integrity sha512-V+Nq70NxKhYt89ArVcaNL9FDryB3vQOd+BFXZIfO3RP6rwtj+2yqqqdHEkacutglPaZLkJeuXKCjCJDMGPtPqg==
axobject-query@2.0.2:
version "2.0.2"
@ -8255,12 +8255,12 @@ lighthouse-stack-packs@^1.4.0:
resolved "https://registry.yarnpkg.com/lighthouse-stack-packs/-/lighthouse-stack-packs-1.4.0.tgz#bf98e0fb04a091ec2d73648842698b41070968ef"
integrity sha512-wdv94WUjaqUwtW8DOapng45Yah62c5O5geNVeoSQlnoagfbTO/YbiwNlfzDIF1xNKRkPlsfr/oWHhXsaHXDivg==
lighthouse@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/lighthouse/-/lighthouse-7.0.0.tgz#3b070f129269889e853fcab629ded9418e417112"
integrity sha512-HxSbbg1WUZFsdUm0U6MCffr6J6marWW8kTlsAGaGh9oE7SFmxHh7eslK5u2sz70QXQZcZf8bfWRIkSx94dFbQA==
lighthouse@^7.2.0:
version "7.2.0"
resolved "https://registry.yarnpkg.com/lighthouse/-/lighthouse-7.2.0.tgz#3368e94804b751586a48e95f39a71c68bee9c4d9"
integrity sha512-f2FLaJIHVACPUHK13Wl0EAvc+8vjSNf3+zjHM9h/WM+qZKpP2FkPOVpWnWs+TjAfsUG3C1alYtG2bzdD6qGmxA==
dependencies:
axe-core "4.1.1"
axe-core "4.1.2"
chrome-launcher "^0.13.4"
configstore "^5.0.1"
cssstyle "1.2.1"