DEV: Correct error handling in run-qunit

runAllTests is an async function, so the try/catch block does not help. The function always returns a promise, so we need to use `.catch` to handle errors. Previously, raised errors were ignored, and the process continued running until it timed out.
This commit is contained in:
David Taylor 2019-12-11 16:50:31 +00:00
parent 4e130f1e03
commit 584021ca38

View File

@ -127,12 +127,10 @@ async function runAllTests() {
}); });
} }
try { runAllTests().catch(e => {
runAllTests();
} catch (e) {
console.log("Failed to run tests: " + e); console.log("Failed to run tests: " + e);
process.exit(1); process.exit(1);
} });
// The following functions are converted to strings // The following functions are converted to strings
// And then sent to chrome to be evalaluated // And then sent to chrome to be evalaluated