From d7b654b219f9816180a837cedc6341bf7d1c0df6 Mon Sep 17 00:00:00 2001 From: Nazar Hussain Date: Wed, 4 Oct 2023 17:38:16 +0200 Subject: [PATCH] Add mocha exit with failure count --- scripts/mocha/mocha_run.mjs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/mocha/mocha_run.mjs b/scripts/mocha/mocha_run.mjs index 38c2974b4c04..abb4b1700c61 100644 --- a/scripts/mocha/mocha_run.mjs +++ b/scripts/mocha/mocha_run.mjs @@ -35,7 +35,8 @@ async function exitScenarioHandler(code) { // Process does not seems to exit with one `process.exit(-1)`, so we try a few times for (let i = 0; i < 5; i++) { - process.exit(-1); + // If there are some failures in the test, we exit with -1 + process.exit(code > 0 ? -1 : 0); await sleep(100); }