Skip to content

Commit f556b20

Browse files
committed
test: auto stops after error caolan#988
1 parent b9cc289 commit f556b20

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/test-async.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,22 @@ exports['auto prevent dead-locks due to cyclic dependencies'] = function(test) {
601601
test.done();
602602
};
603603

604+
// Issue 988 on github: https://github.com/caolan/async/issues/988
605+
exports['auto stops running tasks on error'] = function(test) {
606+
async.auto({
607+
task1: function (callback) {
608+
callback('error');
609+
},
610+
task2: function (callback) {
611+
test.ok(false, 'test2 should not be called');
612+
callback();
613+
}
614+
}, 1, function (error) {
615+
test.equal(error, 'error', 'finishes with error');
616+
test.done();
617+
});
618+
};
619+
604620
// Issue 306 on github: https://github.com/caolan/async/issues/306
605621
exports['retry when attempt succeeds'] = function(test) {
606622
var failed = 3;

0 commit comments

Comments
 (0)