Test case showing a bug in nextTick ordering

nextTick should fire before setTimeout in this test, but it doesn't.
This commit is contained in:
Felix Geisendörfer 2010-09-08 07:34:21 +02:00 committed by Ryan Dahl
parent 1d0fb850d9
commit cf4b5fc52a

View File

@ -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']);
});