Skip to content

Commit

Permalink
add test for #557, #558
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Early committed Jun 1, 2015
1 parent c49e59a commit 32b4ce6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down
15 changes: 15 additions & 0 deletions test/test-async.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
Expand Down

0 comments on commit 32b4ce6

Please sign in to comment.