summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Early <aearly@fluid.com>2015-05-31 19:32:20 -0700
committerAlexander Early <aearly@fluid.com>2015-05-31 19:32:20 -0700
commitc49e59a838e67abf9f2b81c1263cbf2b07e9bad8 (patch)
tree54c06f9fef8febaacca75d9893a9817cabaead47
parent10c1d677b2727c88dca00c2a74440f7ad3adf2e2 (diff)
downloadasync-c49e59a838e67abf9f2b81c1263cbf2b07e9bad8.tar.gz
add test for #578. Closes #578
-rw-r--r--CHANGELOG.md3
-rwxr-xr-xtest/test-async.js12
2 files changed, 14 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3d67c0c..dc023fb 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -13,7 +13,8 @@ Bug Fixes:
- `forever` will no longer stack overflow with a synchronous iterator (#622)
- `eachLimit` and others limit functions will stop iterating once an error occurs (#754)
- Always pass `null` in callbacks when there is no error (#439)
-- Ensure proper conditions when calling `drain()` after pushing an empty data set to a queue (#668)
+- Ensure proper conditions when calling `drain()` after pushing an empty data set to a queue (#668)
+- `each` and family will properly handle an empty array (#578)
- Doc fixes (#766)
diff --git a/test/test-async.js b/test/test-async.js
index ded054b..5b60195 100755
--- a/test/test-async.js
+++ b/test/test-async.js
@@ -1371,6 +1371,18 @@ exports['forEachOf empty object'] = function(test){
setTimeout(test.done, 25);
};
+exports['forEachOf empty array'] = function(test){
+ test.expect(1);
+ async.forEachOf([], function(value, key, callback){
+ test.ok(false, 'iterator should not be called');
+ callback();
+ }, function(err) {
+ if (err) throw err;
+ test.ok(true, 'should call callback');
+ });
+ setTimeout(test.done, 25);
+};
+
exports['forEachOf error'] = function(test){
test.expect(1);
async.forEachOf({ a: 1, b: 2 }, function(value, key, callback) {