summaryrefslogtreecommitdiff
path: root/mocha_test/auto.js
diff options
context:
space:
mode:
Diffstat (limited to 'mocha_test/auto.js')
-rw-r--r--mocha_test/auto.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/mocha_test/auto.js b/mocha_test/auto.js
index fb779ee..6d30815 100644
--- a/mocha_test/auto.js
+++ b/mocha_test/auto.js
@@ -305,6 +305,23 @@ describe('auto', function () {
done();
});
+ // Issue 1092 on github: https://github.com/caolan/async/issues/1092
+ it('extended cycle detection', function(done) {
+ var task = function (name) {
+ return function (results, callback) {
+ callback(null, 'task ' + name);
+ };
+ };
+ expect(function () {
+ async.auto({
+ a: ['c', task('a')],
+ b: ['a', task('b')],
+ c: ['b', task('c')]
+ });
+ }).to.throw();
+ done();
+ });
+
// Issue 988 on github: https://github.com/caolan/async/issues/988
it('auto stops running tasks on error', function(done) {
async.auto({
@@ -349,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;