From 5e806405674ded0fdaa6407b60518f73e19116c3 Mon Sep 17 00:00:00 2001 From: Michael Kelly Date: Tue, 24 Jul 2018 15:11:20 -0700 Subject: [PATCH] Improve error message when Firefox binary path is misconfigured. --- bin/run_tests.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bin/run_tests.py b/bin/run_tests.py index aadfd15..1770779 100755 --- a/bin/run_tests.py +++ b/bin/run_tests.py @@ -31,6 +31,13 @@ help='Path to Firefox binary', ) def main(firefox_bin): + if not firefox_bin: + raise click.BadParameter( + 'No Firefox binary found; configure the path to Firefox with `npm config`.' + ) + elif not os.path.exists(firefox_bin): + raise click.BadParameter('Path to Firefox binary does not exist.') + click.echo('== Building test bundle with Webpack') bundle_handle, bundle_path = mkstemp() try: