1 var common = require('../common');
2 var assert = require('assert');
4 // setImmediate should run clear its queued cbs once per event loop turn
5 // but immediates queued while processing the current queue should happen
6 // on the next turn of the event loop.
8 // in v0.10 hit should be 1, because we only process one cb per turn
9 // in v0.11 and beyond it should be the exact same size of QUEUE
10 // if we're letting things recursively add to the immediate QUEUE hit will be
20 process.nextTick(function() { ticked = true; });
28 for (var i = 0; i < QUEUE; i++)
31 process.on('exit', function() {
32 console.log('hit', hit);
33 assert.strictEqual(hit, QUEUE, 'We ticked between the immediate queue');