caolan/async — Issue #106: async.waterfall is not working with Sinon.JS fake timers
Author: rstuven
Created: 2012-02-27 17:11:55+00:00
State: open

Using `async.series`, the following example works just fine.

```javascript
var async = require("async");
var sinon = require("sinon");

var clock = sinon.useFakeTimers();

async.series([
function fn1(cb) {
console.log("fn1");
setTimeout(function(){
cb();
}, 100);
},
function fn2(cb) {
console.log("fn2");
cb();
}
]);

clock.tick(1000);
```

But if we change `async.series` by `async.waterfall`, the program exits before `fn2` is called.

```javascript
var async = require("async");
var sinon = require("sinon");

var clock = sinon.useFakeTimers();

async.waterfall([
function fn1(cb) {
console.log("fn1");
setTimeout(function(){
cb();
}, 100);
},
function fn2(cb) {
console.log("fn2");
cb();
}
]);

clock.tick(1000);
```