Add an error message when chrome binary is not found
This avoids confusion (such as I just encountered!) when trying to run
tests just exits immediately with no information.
Change-Id: I369f0082948f2deae5e90e24aa68d57bfb608a9b
Bug: none
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4166281
Auto-Submit: Dustin Mitchell <djmitche@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
diff --git a/scripts/npm_test.js b/scripts/npm_test.js
index a0fcfd5..011aa49 100644
--- a/scripts/npm_test.js
+++ b/scripts/npm_test.js
@@ -33,9 +33,13 @@
fs.mkdirSync(CACHE_PATH);
}
- const hasUserCompiledContentShell = utils.isFile(getContentShellBinaryPath(RELEASE_PATH));
+ const contentShellBinaryPath = getContentShellBinaryPath(RELEASE_PATH);
+ const hasUserCompiledContentShell = utils.isFile(contentShellBinaryPath);
if (!hasUserCompiledContentShell) {
- return;
+ throw new Error(
+ `${contentShellBinaryPath} not found. ` +
+ 'Ensure you have built a release version of `chrome` or use ' +
+ '`--target=Debug`.');
}
const outDir = path.resolve(RELEASE_PATH, '..');