From 9a2267ca2e8180d761dc05a46984458626e6f59f Mon Sep 17 00:00:00 2001 From: Hans Larsen Date: Mon, 7 Nov 2016 09:36:30 -0800 Subject: [PATCH] chore(e2e): fix early process exit to fail with error code 255 --- tests/e2e_runner.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/e2e_runner.js b/tests/e2e_runner.js index b66eee1495b8..989380c1ec2e 100644 --- a/tests/e2e_runner.js +++ b/tests/e2e_runner.js @@ -36,6 +36,18 @@ const argv = minimist(process.argv.slice(2), { }); +/** + * Set the error code of the process to 255. This is to ensure that if something forces node + * to exit without finishing properly, the error code will be 255. Right now that code is not used. + * + * When tests succeed we already call `process.exit(0)`, so this doesn't change any correct + * behaviour. + * + * One such case that would force node <= v6 to exit with code 0, is a Promise that doesn't resolve. + */ +process.exitCode = 255; + + let currentFileName = null; let index = 0;