From 293fce63a93350db8c6821dd727e465cc92cde73 Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Thu, 13 Sep 2018 15:56:36 -0400 Subject: [PATCH] add thens to catch errors --- lib/tests/run_tests.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/tests/run_tests.js b/lib/tests/run_tests.js index c13a3b29..c2b5c2c8 100644 --- a/lib/tests/run_tests.js +++ b/lib/tests/run_tests.js @@ -137,9 +137,10 @@ module.exports = { } console.log(`Coverage report created. You can find it here: ${fs.dappPath('coverage/index.html')}\n`); const opn = require('opn'); - opn(fs.dappPath('coverage/index.html')); - - setTimeout(next, 1000); // Slight delay to enable the browser to open. opn's promise calls too fast + const _next = () => { next(); }; + opn(fs.dappPath('coverage/index.html'), {wait: false}) + .then(() => new Promise(resolve => setTimeout(resolve, 1000))) + .then(_next, _next); }); } ], (err) => {