summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Early <aearly@fluid.com>2015-05-31 20:36:27 -0700
committerAlexander Early <aearly@fluid.com>2015-05-31 20:38:07 -0700
commit32b4ce66880d0fae5d26e7d144e1c204ec1e4a57 (patch)
treeee9a50c378a7b270a1edab3a9218e8b7c2cbb252
parentc49e59a838e67abf9f2b81c1263cbf2b07e9bad8 (diff)
downloadasync-32b4ce66880d0fae5d26e7d144e1c204ec1e4a57.tar.gz
add test for #557, #558
-rw-r--r--CHANGELOG.md3
-rwxr-xr-xtest/test-async.js15
2 files changed, 17 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index dc023fb..eabdf28 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,10 +11,11 @@ New Features:
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)
+- `eachLimit` and other 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)
- `each` and family will properly handle an empty array (#578)
+- `eachSeries` and family will finish if the underlying array is modified during execution (#557)
- Doc fixes (#766)
diff --git a/test/test-async.js b/test/test-async.js
index 5b60195..2f51443 100755
--- a/test/test-async.js
+++ b/test/test-async.js
@@ -1427,6 +1427,21 @@ exports['eachSeries empty array'] = function(test){
setTimeout(test.done, 25);
};
+exports['eachSeries array modification'] = function(test) {
+ test.expect(1);
+ var arr = [1, 2, 3, 4];
+ async.eachSeries(arr, function (x, callback) {
+ async.setImmediate(callback);
+ }, function () {
+ test.ok(true, 'should call callback');
+ });
+
+ arr.pop();
+ arr.splice(0, 1);
+
+ setTimeout(test.done, 25);
+};
+
exports['eachSeries error'] = function(test){
test.expect(2);
var call_order = [];