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 20, 2016
1 parent b87fe25 commit 29ab76b
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 29ab76b

Please sign in to comment.