Skip to content

Commit

Permalink
docs: remove await from chrome.kill() (#15982)
Browse files Browse the repository at this point in the history
Co-authored-by: Connor Clark <cjamcl@gmail.com>
  • Loading branch information
ajuni880 and connorjclark committed May 13, 2024
1 parent a5f1d62 commit 96e56ed
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions docs/headless-chrome.md
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
});
}

Expand Down
2 changes: 1 addition & 1 deletion docs/puppeteer.md
Original file line number Diff line number Diff line change
Expand Up @@ -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();
```
2 changes: 1 addition & 1 deletion docs/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 96e56ed

Please sign in to comment.