summaryrefslogtreecommitdiff
path: root/mocha_test
diff options
context:
space:
mode:
authorAlexander Early <alexander.early@gmail.com>2016-05-09 13:38:34 -0700
committerAlexander Early <alexander.early@gmail.com>2016-05-09 13:38:34 -0700
commite235125fc58fb2b04322c6b0d2b06158da4919b3 (patch)
tree77fbf05c624fca6637b851dcb9c2acfd5d60ec8f /mocha_test
parenteaba68f571c31875da03f36828f1a36fa334c79c (diff)
downloadasync-e235125fc58fb2b04322c6b0d2b06158da4919b3.tar.gz
handle no-dependency array tasks in auto/autoInject. Closes #1147
Diffstat (limited to 'mocha_test')
-rw-r--r--mocha_test/auto.js12
-rw-r--r--mocha_test/autoInject.js12
2 files changed, 24 insertions, 0 deletions
diff --git a/mocha_test/auto.js b/mocha_test/auto.js
index 49fac6a..19ffac4 100644
--- a/mocha_test/auto.js
+++ b/mocha_test/auto.js
@@ -366,6 +366,18 @@ describe('auto', function () {
}).to.throw();
});
+ it('should handle array tasks with just a function', function (done) {
+ async.auto({
+ a: [function (cb) {
+ cb(null, 1);
+ }],
+ b: ["a", function (results, cb) {
+ expect(results.a).to.equal(1);
+ cb();
+ }]
+ }, done)
+ });
+
it("should avoid unncecessary deferrals", function (done) {
var isSync = true;
diff --git a/mocha_test/autoInject.js b/mocha_test/autoInject.js
index 059c7ae..3d52abd 100644
--- a/mocha_test/autoInject.js
+++ b/mocha_test/autoInject.js
@@ -74,4 +74,16 @@ describe('autoInject', function () {
});
});
+ it('should handle array tasks with just a function', function (done) {
+ async.autoInject({
+ a: [function (cb) {
+ cb(null, 1);
+ }],
+ b: ["a", function (a, cb) {
+ expect(a).to.equal(1);
+ cb();
+ }]
+ }, done)
+ });
+
});