summaryrefslogtreecommitdiff
path: root/test/applyEach.js
diff options
context:
space:
mode:
authorAlex Early <alexander.early@gmail.com>2019-05-19 17:19:10 -0700
committerGitHub <noreply@github.com>2019-05-19 17:19:10 -0700
commit70624e42b59194b3e5d51d201ad5be344f57c3a6 (patch)
tree4244aa5a8e7ad91fc81a627a04ca73c929ba949a /test/applyEach.js
parentafe6be443b95bd55fdffba4eee210923f109c3d8 (diff)
parent667e71760e7f2dd558e868796bd6e6008a3bac16 (diff)
downloadasync-70624e42b59194b3e5d51d201ad5be344f57c3a6.tar.gz
Merge branch 'master' into awaitable-queues
Diffstat (limited to 'test/applyEach.js')
-rw-r--r--test/applyEach.js39
1 files changed, 4 insertions, 35 deletions
diff --git a/test/applyEach.js b/test/applyEach.js
index 4a67ee4..a5fce95 100644
--- a/test/applyEach.js
+++ b/test/applyEach.js
@@ -27,7 +27,7 @@ describe('applyEach', () => {
cb(null, 3);
}, 18);
};
- async.applyEach([one, two, three], 5, (err, results) => {
+ async.applyEach([one, two, three], 5)((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]);
@@ -51,7 +51,7 @@ describe('applyEach', () => {
throw new Error('third task - should not get here');
}
- async.applyEach({one, two, three}, 5, () => {
+ async.applyEach({one, two, three}, 5)(() => {
throw new Error('final callback - should not get here');
});
@@ -84,7 +84,7 @@ describe('applyEach', () => {
cb(null, 3);
}, 15);
}
- async.applyEachSeries([one, two, three], 5, (err, results) => {
+ async.applyEachSeries([one, two, three], 5)((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]);
@@ -109,7 +109,7 @@ describe('applyEach', () => {
function three(/*, cb */) {
throw new Error('third task - should not get here');
}
- async.applyEachSeries([one, two, three], 5, () => {
+ async.applyEachSeries([one, two, three], 5)(() => {
throw new Error('final callback - should not get here');
});
@@ -118,35 +118,4 @@ describe('applyEach', () => {
done();
}, 25);
});
-
- it('applyEach partial application', (done) => {
- var call_order = [];
- var one = function (val, cb) {
- expect(val).to.equal(5);
- setTimeout(() => {
- call_order.push('one');
- cb(null, 1);
- }, 10);
- };
- var two = function (val, cb) {
- expect(val).to.equal(5);
- setTimeout(() => {
- call_order.push('two');
- cb(null, 2);
- }, 5);
- };
- var three = function (val, cb) {
- expect(val).to.equal(5);
- setTimeout(() => {
- call_order.push('three');
- cb(null, 3);
- }, 15);
- };
- async.applyEach([one, two, three])(5, (err, results) => {
- if (err) throw err;
- expect(call_order).to.eql(['two', 'one', 'three']);
- expect(results).to.eql([1, 2, 3]);
- done();
- });
- });
});