Skip to content

Commit

Permalink
Test case showing a bug in nextTick ordering
Browse files Browse the repository at this point in the history
nextTick should fire before setTimeout in this test, but it doesn't.
  • Loading branch information
felixge authored and ry committed Sep 9, 2010
1 parent dffa9e7 commit 3d3d00d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/simple/test-next-tick-ordering2.js
Original file line number Diff line number Diff line change
@@ -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']);
});

0 comments on commit 3d3d00d

Please sign in to comment.