summaryrefslogtreecommitdiff
path: root/test/test-async.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/test-async.js')
-rwxr-xr-xtest/test-async.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/test-async.js b/test/test-async.js
index 18894b0..8d68ae4 100755
--- a/test/test-async.js
+++ b/test/test-async.js
@@ -1347,6 +1347,19 @@ exports['forEachOf'] = function(test){
});
};
+exports['forEachOf - instant resolver'] = function(test){
+ test.expect(1);
+ var args = [];
+ async.forEachOf({ a: 1, b: 2 }, function(x, k, cb) {
+ args.push(k, x);
+ cb();
+ }, function(){
+ // ensures done callback isn't called before all items iterated
+ test.same(args, ["a", 1, "b", 2]);
+ test.done();
+ });
+};
+
exports['forEachOf empty object'] = function(test){
test.expect(1);
async.forEachOf({}, function(value, key, callback){