summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Cox <th3james@gmail.com>2013-12-02 21:20:52 +0000
committerJames Cox <th3james@gmail.com>2013-12-02 21:20:52 +0000
commite61160d03b8955f5c01d6caed476e4c9a6076a4a (patch)
treea2d1fb399e3f01b81c58b1a93ea959a17dc07fd1
parentf01b3992fbe7aa2f4881152143608ad666aea1cc (diff)
downloadasync-e61160d03b8955f5c01d6caed476e4c9a6076a4a.tar.gz
Failing auto double callback on error test
-rwxr-xr-xtest/test-async.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/test-async.js b/test/test-async.js
index ff401e7..39d61be 100755
--- a/test/test-async.js
+++ b/test/test-async.js
@@ -431,6 +431,27 @@ exports['auto removeListener has side effect on loop iterator'] = function(test)
});
};
+// Issue 410 on github: https://github.com/caolan/async/issues/410
+exports['auto calls callback multiple times'] = function(test) {
+ var finalCallCount = 0;
+ async.auto({
+ task1: function(callback) { callback(null); },
+ task2: ['task1', function(callback) { callback(null); }]
+ },
+
+ // Final callback. This should only run once...
+ function(err) {
+ finalCallCount++;
+ console.log('Called ' + finalCallCount + ' times');
+ if (finalCallCount > 1) {
+ test.done(new Error("Final auto callback should only be called once"));
+ } else {
+ test.done();
+ throw new Error("An error");
+ }
+ });
+};
+
exports['waterfall'] = function(test){
test.expect(6);
var call_order = [];