Browse Source

Test case showing a bug in nextTick ordering

nextTick should fire before setTimeout in this test, but it doesn't.
v0.7.4-release
Felix Geisendörfer 15 years ago
committed by Ryan Dahl
parent
commit
cf4b5fc52a
  1. 17
      test/simple/test-next-tick-ordering2.js

17
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']);
});
Loading…
Cancel
Save