diff --git a/lib/tests/run_tests.js b/lib/tests/run_tests.js index c13a3b296..c2b5c2c82 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) => {