Skip to content

Commit

Permalink
test: ensure nextTick is not scheduled in exit
Browse files Browse the repository at this point in the history
Previously our tests did not check this codepath as seen at
coverage.nodejs.org

PR-URL: #9555
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
  • Loading branch information
Fishrock123 authored and MylesBorins committed Dec 21, 2016
1 parent 511c3f7 commit 127e64d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/parallel/test-next-tick-when-exiting.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
'use strict';

const common = require('../common');
const assert = require('assert');

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

process.nextTick(() => {
common.fail('process is exiting, should not be called.');
});
});

process.exit();

0 comments on commit 127e64d

Please sign in to comment.