docs: remove await from chrome.kill() (#15982)
Co-authored-by: Connor Clark <cjamcl@gmail.com>
This commit is contained in:
Родитель
a5f1d622d1
Коммит
96e56ed99c
|
@ -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;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
```
|
||||
|
|
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче