Permalink
Browse files

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: #20956
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Weijia Wang <starkwang@126.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
  • Loading branch information...
thatshailesh authored and apapirovski committed May 25, 2018
1 parent a69a29d commit 8055bdbbc9badb2042e44a8e843e364f2b3f6284
Showing with 5 additions and 5 deletions.
  1. +5 −5 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();

0 comments on commit 8055bdb

Please sign in to comment.