From db05e8250d274fe220f0e2274f1c5967c0c461d1 Mon Sep 17 00:00:00 2001 From: erezrokah Date: Sun, 5 Jul 2020 17:44:16 +0300 Subject: [PATCH 1/2] fix: add chrome --disable-dev-shm-usage flag --- src/lighthouse.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lighthouse.js b/src/lighthouse.js index d7d1d198..9a27d8a3 100644 --- a/src/lighthouse.js +++ b/src/lighthouse.js @@ -22,7 +22,12 @@ const runLighthouse = async (browserPath, url) => { log.setLevel(logLevel); chrome = await chromeLauncher.launch({ chromePath: browserPath, - chromeFlags: ['--headless', '--no-sandbox', '--disable-gpu'], + chromeFlags: [ + '--headless', + '--no-sandbox', + '--disable-gpu', + '--disable-dev-shm-usage', + ], logLevel, }); const results = await lighthouse(url, { From a1b37aae0fd343c8e94ee5e3742fc8a6fb9fb512 Mon Sep 17 00:00:00 2001 From: erezrokah Date: Sun, 5 Jul 2020 18:22:33 +0300 Subject: [PATCH 2/2] fix: handle null scores --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 58a77d83..af1e9778 100644 --- a/src/index.js +++ b/src/index.js @@ -51,7 +51,7 @@ const getError = (id, expected, results) => { return `Expected category ${chalk.magenta( category.title, )} to be greater or equal to ${chalk.green(expected)} but got ${chalk.red( - category.score, + category.score !== null ? category.score : 'unknown', )}`; };