diff --git a/test/parallel/test-next-tick-when-exiting.js b/test/parallel/test-next-tick-when-exiting.js new file mode 100644 index 0000000000..1bb4c914d0 --- /dev/null +++ b/test/parallel/test-next-tick-when-exiting.js @@ -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();