Skip to content

Commit ea81d42

Browse files
thatshaileshaddaleax
authored andcommitted
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 <[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]>
1 parent 46d1025 commit ea81d42

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
'use strict';
22

3-
require('../common');
3+
const common = require('../common');
44
const assert = require('assert');
55

66
process.on('exit', () => {
7-
assert.strictEqual(process._exiting, true, 'process._exiting was not set!');
7+
assert.strictEqual(process._exiting, true);
88

9-
process.nextTick(() => {
10-
assert.fail('process is exiting, should not be called.');
11-
});
9+
process.nextTick(
10+
common.mustNotCall('process is exiting, should not be called')
11+
);
1212
});
1313

1414
process.exit();

0 commit comments

Comments
 (0)