From c8bbd83ab24fc1ba0517f0b3ab34b0dc0c28a545 Mon Sep 17 00:00:00 2001 From: Nitzan Uziely Date: Wed, 7 Apr 2021 01:21:03 +0300 Subject: [PATCH] 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 Reviewed-By: James M Snell Reviewed-By: Colin Ihrig --- test/fixtures/process-exit-code-cases.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/fixtures/process-exit-code-cases.js b/test/fixtures/process-exit-code-cases.js index 495562987d7d4f..05b01afd8f4630 100644 --- a/test/fixtures/process-exit-code-cases.js +++ b/test/fixtures/process-exit-code-cases.js @@ -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;