summaryrefslogtreecommitdiff
path: root/test/test-async.js
diff options
context:
space:
mode:
authorCaolan McMahon <caolan@caolanmcmahon.com>2013-03-15 12:48:13 +0000
committerCaolan McMahon <caolan@caolanmcmahon.com>2013-03-15 12:48:13 +0000
commitcce102df20916956f5ccad82b7da6019387e2fdc (patch)
tree9ffda1f639b73ce21879506e085d158f0065cde2 /test/test-async.js
parenta0d565d01bd256ea3d67104925139576d110aadb (diff)
downloadasync-cce102df20916956f5ccad82b7da6019387e2fdc.tar.gz
added forever
Diffstat (limited to 'test/test-async.js')
-rwxr-xr-xtest/test-async.js18
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 = [];