diff options
author | Graeme Yeates <yeatesgraeme@gmail.com> | 2015-08-29 15:29:34 -0400 |
---|---|---|
committer | Graeme Yeates <yeatesgraeme@gmail.com> | 2015-08-29 15:30:53 -0400 |
commit | 62e87045af76b334b135e80fdd7a21a8b2f25a72 (patch) | |
tree | 0a3880d7989d00bf0992e7fe72bb0bd1a3484991 /test/test-async.js | |
parent | b2fded336afaef589eddb602b29a228faffcb21e (diff) | |
download | async-62e87045af76b334b135e80fdd7a21a8b2f25a72.tar.gz |
Implement eachOf through _keyIteratoriters
Diffstat (limited to 'test/test-async.js')
-rwxr-xr-x | test/test-async.js | 13 |
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){ |