diff --git a/test/fixtures/process-exit-code-cases.js b/test/fixtures/process-exit-code-cases.js index 05b01afd8f46305..9afbda4d308090f 100644 --- a/test/fixtures/process-exit-code-cases.js +++ b/test/fixtures/process-exit-code-cases.js @@ -63,8 +63,14 @@ function getTestCases(isWorker = false) { function zeroExitWithUncaughtHandler() { process.on('exit', (code) => { - assert.strictEqual(process.exitCode, 0); - assert.strictEqual(code, 0); + if (code !== 0) { + console.log('wrong code! expected 0; got', code); + process.exit(99); + } + if (process.exitCode !== undefined) { + console.log('wrong exitCode! expected undefined; got', process.exitCode); + process.exit(99); + } }); process.on('uncaughtException', () => { }); throw new Error('ok'); @@ -73,8 +79,14 @@ function getTestCases(isWorker = false) { function changeCodeInUncaughtHandler() { process.on('exit', (code) => { - assert.strictEqual(process.exitCode, 97); - assert.strictEqual(code, 97); + if (code !== 97) { + console.log('wrong code! expected 97; got', code); + process.exit(99); + } + if (process.exitCode !== 97) { + console.log('wrong exitCode! expected 97; got', process.exitCode); + process.exit(99); + } }); process.on('uncaughtException', () => { process.exitCode = 97;