summaryrefslogtreecommitdiff
path: root/test/test-async.js
diff options
context:
space:
mode:
authorCaolan McMahon <caolan@caolanmcmahon.com>2012-05-24 00:12:42 -0700
committerCaolan McMahon <caolan@caolanmcmahon.com>2012-05-24 00:12:42 -0700
commit16b9271e5c684cd7729fa3906032536509e3a4a0 (patch)
treec1d1b0c6ab3a9b7193ed7aaa77e2e88a0d49ee00 /test/test-async.js
parentb0aa0f18733bbf0b451f0971dcbd22bbb3060ad0 (diff)
downloadasync-16b9271e5c684cd7729fa3906032536509e3a4a0.tar.gz
fix occasional synchronous use of forEachLimit
Diffstat (limited to 'test/test-async.js')
-rw-r--r--test/test-async.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/test-async.js b/test/test-async.js
index ff4b749..ac45272 100644
--- a/test/test-async.js
+++ b/test/test-async.js
@@ -635,6 +635,18 @@ exports['forEachLimit no callback'] = function(test){
async.forEachLimit([1], 1, forEachNoCallbackIterator.bind(this, test));
};
+exports['forEachLimit synchronous'] = function(test){
+ var args = [];
+ var arr = [0,1,2];
+ async.forEachLimit(arr, 5, function(x,callback){
+ args.push(x);
+ callback();
+ }, function(err){
+ test.same(args, arr);
+ test.done();
+ });
+};
+
exports['map'] = function(test){
var call_order = [];
async.map([1,3,2], mapIterator.bind(this, call_order), function(err, results){