summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authormtone <realsmash2000@yahoo.com>2014-06-09 21:37:49 -0400
committerGraeme Yeates <yeatesgraeme@gmail.com>2015-07-02 11:26:43 -0400
commit06813bffd737a183d01e0fa89d70a31635019676 (patch)
tree72679044212de5213c97f2e5bd0d37bbcd36dd6e /test
parent0ed159afd094ff1446fce6d616064f9c31fb7d2a (diff)
downloadasync-06813bffd737a183d01e0fa89d70a31635019676.tar.gz
Added async.someLimit
When checking if a folder contains subfolders or not (fs.readdir -> fs.stat -> some(is_a_Folder)), getting crashes when listing Windows shares from Ubuntu VM. someLimit avoids the problem. Test for someLimit added anyLimit alias and updated doc. removed anyLimit alias
Diffstat (limited to 'test')
-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 25e964e..fe94ddc 100755
--- a/test/test-async.js
+++ b/test/test-async.js
@@ -2236,6 +2236,24 @@ exports['some early return'] = function(test){
}, 100);
};
+exports['someLimit true'] = function(test){
+ async.someLimit([3,1,2], 2, function(x, callback){
+ setTimeout(function(){callback(x === 2);}, 0);
+ }, function(result){
+ test.equals(result, true);
+ test.done();
+ });
+};
+
+exports['someLimit false'] = function(test){
+ async.someLimit([3,1,2], 2, function(x, callback){
+ setTimeout(function(){callback(x === 10);}, 0);
+ }, function(result){
+ test.equals(result, false);
+ test.done();
+ });
+};
+
exports['any alias'] = function(test){
test.equals(async.any, async.some);
test.done();