Skip to content

Commit

Permalink
test: add undefined fatalException exit code test
Browse files Browse the repository at this point in the history
Add a test that checks the exit code when _fatalException
is undefined

PR-URL: #38119
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
Linkgoron authored and targos committed May 1, 2021
1 parent bb8db84 commit 605f830
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/fixtures/process-exit-code-cases.js
Expand Up @@ -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;

0 comments on commit 605f830

Please sign in to comment.