Skip to content

Commit

Permalink
test: show actual error in next-tick-when-exiting
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-By: Weijia Wang <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
  • Loading branch information
thatshailesh authored and addaleax committed Jun 1, 2018
1 parent 46d1025 commit ea81d42
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/parallel/test-next-tick-when-exiting.js
Original file line number Diff line number Diff line change
@@ -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 ea81d42

Please sign in to comment.