Catch promise errors and exit with code 1
This commit is contained in:
@@ -103,4 +103,9 @@ const runFile = async (file, action, page, script) => {
|
||||
|
||||
// close the browser window we used
|
||||
await browser.close();
|
||||
})();
|
||||
})().catch(err => {
|
||||
// Handle promise rejections by exiting with a nonzero code to ensure that tests don't erroneously pass
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
@@ -117,4 +117,9 @@ const testFile = (file, page) => test(file, async t => {
|
||||
|
||||
// close the browser window we used
|
||||
await browser.close();
|
||||
})();
|
||||
})().catch(err => {
|
||||
// Handle promise rejections by exiting with a nonzero code to ensure that tests don't erroneously pass
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user