From 638234c360f58795ceeaeef7c7502040af650ae9 Mon Sep 17 00:00:00 2001 From: Junaid Aslam Date: Tue, 30 Apr 2024 19:41:03 +0100 Subject: [PATCH 1/2] docs: remove await keyowrd --- docs/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/readme.md b/docs/readme.md index a2d8ad980a81..d7091b98a992 100644 --- a/docs/readme.md +++ b/docs/readme.md @@ -24,7 +24,7 @@ fs.writeFileSync('lhreport.html', reportHtml); console.log('Report is done for', runnerResult.lhr.finalDisplayedUrl); console.log('Performance score was', runnerResult.lhr.categories.performance.score * 100); -await chrome.kill(); +chrome.kill(); ``` ### Performance-only Lighthouse run From adc22eaaf2e8bd40bbc979bd2f94993797f218b4 Mon Sep 17 00:00:00 2001 From: Connor Clark Date: Mon, 13 May 2024 14:24:43 -0700 Subject: [PATCH 2/2] more --- docs/headless-chrome.md | 6 ++++-- docs/puppeteer.md | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/headless-chrome.md b/docs/headless-chrome.md index 96e4061b4042..20de67a71148 100644 --- a/docs/headless-chrome.md +++ b/docs/headless-chrome.md @@ -101,8 +101,10 @@ const chromeLauncher = require('chrome-launcher'); function launchChromeAndRunLighthouse(url, flags = {}, config = null) { return chromeLauncher.launch(flags).then(chrome => { flags.port = chrome.port; - return lighthouse(url, flags, config).then(results => - chrome.kill().then(() => results)); + return lighthouse(url, flags, config).then(results => { + chrome.kill(); + return results; + } }); } diff --git a/docs/puppeteer.md b/docs/puppeteer.md index dcb9de10cfa4..68c62e0d5256 100644 --- a/docs/puppeteer.md +++ b/docs/puppeteer.md @@ -73,5 +73,5 @@ const {lhr} = await lighthouse(url, undefined, undefined, page); console.log(`Lighthouse scores: ${Object.values(lhr.categories).map(c => c.score).join(', ')}`); await browser.disconnect(); -await chrome.kill(); +chrome.kill(); ```