[Pkg-javascript-commits] [node-async] 419/480: add test case for embedding async.retry in another control flow

Jonas Smedegaard js at moszumanska.debian.org
Fri May 2 08:58:48 UTC 2014


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository node-async.

commit 049eda0877b652246622a6e0edc3aef8d14ceac6
Author: Jesse Houchins <jesse.houchins at tstmedia.com>
Date:   Fri Mar 28 23:37:23 2014 -0500

    add test case for embedding async.retry in another control flow
---
 test/test-async.js | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/test/test-async.js b/test/test-async.js
index 7095af5..6d6b757 100755
--- a/test/test-async.js
+++ b/test/test-async.js
@@ -614,6 +614,27 @@ exports['retry when all attempts succeeds'] = function(test) {
     });
 };
 
+exports['retry as an embedded task'] = function(test) {
+    var retryResult = 'RETRY';
+    var fooResults;
+    var retryResults;
+    
+    async.auto({
+        foo: function(callback, results){
+            fooResults = results;
+            callback(null, 'FOO');
+        },
+        retry: async.retry(function(callback, results) {
+            retryResults = results;
+            callback(null, retryResult);
+        })
+    }, function(err, results){
+        test.equal(results.retry, retryResult, "Incorrect result was returned from retry function");
+        test.equal(fooResults, retryResults, "Incorrect results were passed to retry function");
+        test.done();
+    });
+};
+
 exports['waterfall'] = function(test){
     test.expect(6);
     var call_order = [];

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-async.git



More information about the Pkg-javascript-commits mailing list