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(); ``` 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