summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregor Martynus <gregor@martynus.net>2015-12-30 16:43:41 +0100
committerGregor Martynus <gregor@martynus.net>2015-12-30 16:43:41 +0100
commitf556b202d418c59de8f76e409d82c75b12f5a9ca (patch)
treebab8e03fe4449243316c1fbb186638a2765d0e38
parentb9cc28973144a9e1a84184d9d0bf48749899bfd9 (diff)
downloadasync-f556b202d418c59de8f76e409d82c75b12f5a9ca.tar.gz
test: auto stops after error #988
-rwxr-xr-xtest/test-async.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/test-async.js b/test/test-async.js
index ee0b950..05c0228 100755
--- a/test/test-async.js
+++ b/test/test-async.js
@@ -601,6 +601,22 @@ exports['auto prevent dead-locks due to cyclic dependencies'] = function(test) {
test.done();
};
+// Issue 988 on github: https://github.com/caolan/async/issues/988
+exports['auto stops running tasks on error'] = function(test) {
+ async.auto({
+ task1: function (callback) {
+ callback('error');
+ },
+ task2: function (callback) {
+ test.ok(false, 'test2 should not be called');
+ callback();
+ }
+ }, 1, function (error) {
+ test.equal(error, 'error', 'finishes with error');
+ test.done();
+ });
+};
+
// Issue 306 on github: https://github.com/caolan/async/issues/306
exports['retry when attempt succeeds'] = function(test) {
var failed = 3;