From 1d5ca820df83795aa16ebd18e96a2ae76ed404c8 Mon Sep 17 00:00:00 2001 From: Ben Newman Date: Wed, 3 Aug 2016 15:21:16 -0400 Subject: [PATCH] Don't swallow unexpected errors when checking for phantomjs-prebuilt. --- tools/tool-testing/selftest.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/tool-testing/selftest.js b/tools/tool-testing/selftest.js index 15fe71bd31..c2ae7feb44 100644 --- a/tools/tool-testing/selftest.js +++ b/tools/tool-testing/selftest.js @@ -30,7 +30,7 @@ var upgraders = require('../upgraders.js'); require("../tool-env/install-runtime.js"); try { - var phantomjs = require('phantomjs-prebuilt'); + var phantomPath = require.resolve('phantomjs-prebuilt'); } catch (e) { throw new Error([ "Please install PhantomJS by running the following command:", @@ -42,6 +42,8 @@ try { ].join("\n")); } +var phantomjs = require(phantomPath); + // To allow long stack traces that cross async boundaries require('longjohn');