Skip to content

Commit 53ea049

Browse files
hanslMRHarrison
authored andcommitted
chore(e2e): fix early process exit to fail with error code 255 (angular#3049)
1 parent 7098c96 commit 53ea049

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
@@ -38,6 +38,18 @@ const argv = minimist(process.argv.slice(2), {
3838
});
3939

4040

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

0 commit comments

Comments
 (0)