From 8055bdbbc9badb2042e44a8e843e364f2b3f6284 Mon Sep 17 00:00:00 2001 From: Shailesh Shekhawat Date: Fri, 25 May 2018 11:00:53 +0800 Subject: [PATCH] test: show actual error in next-tick-when-exiting On process exit if some assertion error occurs value of `process._exiting` was hidden, this fix will show the actual error message with value. PR-URL: https://github.com/nodejs/node/pull/20956 Reviewed-By: Luigi Pinca Reviewed-By: Weijia Wang Reviewed-By: Ruben Bridgewater Reviewed-By: Rich Trott Reviewed-By: Trivikram Kamat --- test/parallel/test-next-tick-when-exiting.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/parallel/test-next-tick-when-exiting.js b/test/parallel/test-next-tick-when-exiting.js index b64befa8578..36dc2966462 100644 --- a/test/parallel/test-next-tick-when-exiting.js +++ b/test/parallel/test-next-tick-when-exiting.js @@ -1,14 +1,14 @@ 'use strict'; -require('../common'); +const common = require('../common'); const assert = require('assert'); process.on('exit', () => { - assert.strictEqual(process._exiting, true, 'process._exiting was not set!'); + assert.strictEqual(process._exiting, true); - process.nextTick(() => { - assert.fail('process is exiting, should not be called.'); - }); + process.nextTick( + common.mustNotCall('process is exiting, should not be called') + ); }); process.exit();