From f556b202d418c59de8f76e409d82c75b12f5a9ca Mon Sep 17 00:00:00 2001 From: Gregor Martynus Date: Wed, 30 Dec 2015 16:43:41 +0100 Subject: [PATCH] test: auto stops after error #988 --- test/test-async.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/test-async.js b/test/test-async.js index ee0b950d6..05c022827 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;