diff options
author | Alexander Early <alexander.early@gmail.com> | 2016-04-07 14:06:05 -0700 |
---|---|---|
committer | Alexander Early <alexander.early@gmail.com> | 2016-04-07 14:06:05 -0700 |
commit | b00abf296e13ee33b5a987e9b8484881aefa6d0f (patch) | |
tree | d726d55684e594554461397fc1bce88b64732553 /mocha_test | |
parent | 167a019496ba1b4e83f29ef502e4a7e2f056ba85 (diff) | |
download | async-b00abf296e13ee33b5a987e9b8484881aefa6d0f.tar.gz |
have applyEach pass results to the callback. Closes #1088
Diffstat (limited to 'mocha_test')
-rw-r--r-- | mocha_test/applyEach.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/mocha_test/applyEach.js b/mocha_test/applyEach.js index d2080a6..6138d3f 100644 --- a/mocha_test/applyEach.js +++ b/mocha_test/applyEach.js @@ -27,9 +27,10 @@ describe('applyEach', function () { cb(null, 3); }, 15); }; - async.applyEach([one, two, three], 5, function (err) { + async.applyEach([one, two, three], 5, function (err, results) { assert(err === null, err + " passed instead of 'null'"); expect(call_order).to.eql(['two', 'one', 'three']); + expect(results).to.eql([1, 2, 3]); done(); }); }); @@ -57,9 +58,10 @@ describe('applyEach', function () { cb(null, 3); }, 15); }; - async.applyEachSeries([one, two, three], 5, function (err) { + async.applyEachSeries([one, two, three], 5, function (err, results) { assert(err === null, err + " passed instead of 'null'"); expect(call_order).to.eql(['one', 'two', 'three']); + expect(results).to.eql([1, 2, 3]); done(); }); }); @@ -87,9 +89,10 @@ describe('applyEach', function () { cb(null, 3); }, 15); }; - async.applyEach([one, two, three])(5, function (err) { + async.applyEach([one, two, three])(5, function (err, results) { if (err) throw err; expect(call_order).to.eql(['two', 'one', 'three']); + expect(results).to.eql([1, 2, 3]); done(); }); }); |