From c258c25a38d4c06458b4037bf46504dd06f674f3 Mon Sep 17 00:00:00 2001 From: Clement Michaud Date: Sun, 24 Feb 2019 14:05:11 +0100 Subject: [PATCH] Make process fail when mocha fails on integration tests. --- scripts/authelia-scripts-test | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/authelia-scripts-test b/scripts/authelia-scripts-test index dc9a5e02b..67571b5a2 100755 --- a/scripts/authelia-scripts-test +++ b/scripts/authelia-scripts-test @@ -50,3 +50,10 @@ mocha.stdout.on('data', (data) => { mocha.stderr.on('data', (data) => { process.stderr.write(`${data}`); }); + +mocha.on('exit', function(statusCode) { + if (statusCode != 0) { + console.error("The tests failed... Mocha exited with status code " + statusCode); + } + process.exit(statusCode); +})