diff options
Diffstat (limited to 'test/es2017')
-rw-r--r-- | test/es2017/asyncFunctions.js | 4 | ||||
-rw-r--r-- | test/es2017/awaitableFunctions.js | 17 |
2 files changed, 18 insertions, 3 deletions
diff --git a/test/es2017/asyncFunctions.js b/test/es2017/asyncFunctions.js index 805c666..bf0d708 100644 --- a/test/es2017/asyncFunctions.js +++ b/test/es2017/asyncFunctions.js @@ -272,14 +272,14 @@ module.exports = function () { */ it('should handle async functions in applyEach', (done) => { - async.applyEach([asyncIdentity, asyncIdentity])(input, (err, result) => { + async.applyEach([asyncIdentity, asyncIdentity], input)((err, result) => { expect(result).to.eql([input, input]); done(err); }); }); it('should handle async functions in applyEachSeries', (done) => { - async.applyEachSeries([asyncIdentity, asyncIdentity])(input, (err, result) => { + async.applyEachSeries([asyncIdentity, asyncIdentity], input)((err, result) => { expect(result).to.eql([input, input]); done(err); }); diff --git a/test/es2017/awaitableFunctions.js b/test/es2017/awaitableFunctions.js index 4517fe7..e8adf7b 100644 --- a/test/es2017/awaitableFunctions.js +++ b/test/es2017/awaitableFunctions.js @@ -316,7 +316,22 @@ module.exports = function () { * Control flow */ - // TODO: figure out to do with applyEach + it('should return a Promise: applyEach', async () => { + const calls = [] + await async.applyEach([ + async (v, x) => { calls.push(v, x) }, + async (v, x) => { calls.push(v, x) } + ], 5, 6)(); + expect(calls).to.eql([5, 6, 5, 6]) + }) + it('should return a Promise: applyEachSeries', async () => { + const calls = [] + await async.applyEachSeries([ + async (v, x) => { calls.push(v, x) }, + async (v, x) => { calls.push(v, x) } + ], 5, 6)(); + expect(calls).to.eql([5, 6, 5, 6]) + }) it('should return a Promise: auto', async () => { expect (async.auto.name).to.contain('auto') |