diff options
Diffstat (limited to 'mocha_test/es2017/asyncFunctions.js')
-rw-r--r-- | mocha_test/es2017/asyncFunctions.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/mocha_test/es2017/asyncFunctions.js b/mocha_test/es2017/asyncFunctions.js index 60a1af3..ca76a56 100644 --- a/mocha_test/es2017/asyncFunctions.js +++ b/mocha_test/es2017/asyncFunctions.js @@ -312,6 +312,26 @@ module.exports = function () { }); }); + it('should handle async functions in autoInject (shorthand)', (done) => { + async.autoInject({ + async a() { + return await Promise.resolve(1); + }, + async b(a) { + return await Promise.resolve(a + 1); + }, + async c(a, b) { + return await Promise.resolve(a + b); + }, + async d(c) { + return await Promise.resolve(c + 1); + } + }, (err, result) => { + expect(result).to.eql({a: 1, b: 2, c: 3, d: 4}); + done(err); + }); + }); + it('should handle async functions in cargo', (done) => { var result = []; var q = async.cargo(async function(val) { |