test: add undefined fatalException exit code test

Add a test that checks the exit code when _fatalException
is undefined

PR-URL: https://github.com/nodejs/node/pull/38119
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
Nitzan Uziely
2021-04-07 01:21:03 +03:00
committed by James M Snell
parent 6bbe28552c
commit c8bbd83ab2

View File

@@ -122,6 +122,15 @@ function getTestCases(isWorker = false) {
result: isWorker ? 1 : 7,
error: /^Error: ok$/,
});
function exitWithUndefinedFatalException() {
process._fatalException = undefined;
throw new Error('ok');
}
cases.push({
func: exitWithUndefinedFatalException,
result: 6,
});
return cases;
}
exports.getTestCases = getTestCases;