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 danielleadams committed May 8, 2021
1 parent 22d39d3 commit 48b5196
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/fixtures/process-exit-code-cases.js
Original file line number Diff line number Diff line change
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 48b5196

Please sign in to comment.