summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorCaolan McMahon <caolan@caolanmcmahon.com>2013-03-02 13:02:20 -0800
committerCaolan McMahon <caolan@caolanmcmahon.com>2013-03-02 13:02:20 -0800
commitd321d633d10f2b04d25edd702f9db7614a9cff59 (patch)
tree6baf4063c7d5acd683d5f6805ec541e493f82353 /test
parentb63b80abb77603e8b17bc3213c498d49fcb35e1f (diff)
parent12bce1d66f6b1874d5e7635ba4f8433b24b9e740 (diff)
downloadasync-d321d633d10f2b04d25edd702f9db7614a9cff59.tar.gz
Merge pull request #235 from leahciMic/async_auto_error_receives_partial_results
Send results to auto callback when an error occurs
Diffstat (limited to 'test')
-rwxr-xr-xtest/test-async.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/test-async.js b/test/test-async.js
index ddc86fe..1caf1bc 100755
--- a/test/test-async.js
+++ b/test/test-async.js
@@ -293,6 +293,26 @@ exports['auto no callback'] = function(test){
});
};
+exports['auto error should pass partial results'] = function(test) {
+ async.auto({
+ task1: function(callback){
+ callback(false, 'result1');
+ },
+ task2: ['task1', function(callback){
+ callback('testerror', 'result2');
+ }],
+ task3: ['task2', function(callback){
+ test.ok(false, 'task3 should not be called');
+ }]
+ },
+ function(err, results){
+ test.equals(err, 'testerror');
+ test.equals(results.task1, 'result1');
+ test.equals(results.task2, 'result2');
+ test.done();
+ });
+};
+
// Issue 24 on github: https://github.com/caolan/async/issues#issue/24
// Issue 76 on github: https://github.com/caolan/async/issues#issue/76
exports['auto removeListener has side effect on loop iterator'] = function(test) {