diff options
author | Caolan McMahon <caolan@caolanmcmahon.com> | 2013-03-15 12:48:13 +0000 |
---|---|---|
committer | Caolan McMahon <caolan@caolanmcmahon.com> | 2013-03-15 12:48:13 +0000 |
commit | cce102df20916956f5ccad82b7da6019387e2fdc (patch) | |
tree | 9ffda1f639b73ce21879506e085d158f0065cde2 /test/test-async.js | |
parent | a0d565d01bd256ea3d67104925139576d110aadb (diff) | |
download | async-cce102df20916956f5ccad82b7da6019387e2fdc.tar.gz |
added forever
Diffstat (limited to 'test/test-async.js')
-rwxr-xr-x | test/test-async.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/test-async.js b/test/test-async.js index cba6f4b..f9b9c08 100755 --- a/test/test-async.js +++ b/test/test-async.js @@ -66,6 +66,24 @@ function getFunctionsObject(call_order) { }; } +exports['forever'] = function (test) { + test.expect(1); + var counter = 0; + function addOne(callback) { + counter++; + if (counter === 50) { + return callback('too big!'); + } + async.setImmediate(function () { + callback(); + }); + } + async.forever(addOne, function (err) { + test.equal(err, 'too big!'); + test.done(); + }); +}; + exports['applyEach'] = function (test) { test.expect(4); var call_order = []; |