Skip to content

Commit f65a48f

Browse files
committed
test: ensure nextTick is not scheduled in exit
Previously our tests did not check this codepath as seen at coverage.nodejs.org PR-URL: #9555 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
1 parent 9e698bd commit f65a48f

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
'use strict';
2+
3+
const common = require('../common');
4+
const assert = require('assert');
5+
6+
process.on('exit', () => {
7+
assert.strictEqual(process._exiting, true, 'process._exiting was not set!');
8+
9+
process.nextTick(() => {
10+
common.fail('process is exiting, should not be called.');
11+
});
12+
});
13+
14+
process.exit();

0 commit comments

Comments
 (0)