diff --git a/test/simple/test-next-tick-ordering2.js b/test/simple/test-next-tick-ordering2.js new file mode 100644 index 0000000000..2e7e0d1d37 --- /dev/null +++ b/test/simple/test-next-tick-ordering2.js @@ -0,0 +1,17 @@ +common = require("../common"); +assert = common.assert + +var order = []; +process.nextTick(function () { + process.nextTick(function() { + order.push('nextTick'); + }); + + setTimeout(function() { + order.push('setTimeout'); + }, 0); +}) + +process.addListener('exit', function () { + assert.deepEqual(order, ['nextTick', 'setTimeout']); +});