Skip to content

Commit 9a2267c

Browse files
committed
chore(e2e): fix early process exit to fail with error code 255
1 parent c27cc85 commit 9a2267c

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/e2e_runner.js

+12
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,18 @@ const argv = minimist(process.argv.slice(2), {
3636
});
3737

3838

39+
/**
40+
* Set the error code of the process to 255. This is to ensure that if something forces node
41+
* to exit without finishing properly, the error code will be 255. Right now that code is not used.
42+
*
43+
* When tests succeed we already call `process.exit(0)`, so this doesn't change any correct
44+
* behaviour.
45+
*
46+
* One such case that would force node <= v6 to exit with code 0, is a Promise that doesn't resolve.
47+
*/
48+
process.exitCode = 255;
49+
50+
3951
let currentFileName = null;
4052
let index = 0;
4153

0 commit comments

Comments
 (0)