Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
test: add undefined fatalException exit code test
Add a test that checks the exit code when _fatalException
is undefined
  • Loading branch information
Linkgoron committed Apr 6, 2021
commit 1a699ade9d5d1ac7b1ca9c836e03a7eb9baf9046
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;