diff options
author | Alexander Early <alexander.early@gmail.com> | 2018-06-03 22:45:28 -0700 |
---|---|---|
committer | Alexander Early <alexander.early@gmail.com> | 2018-06-03 22:45:28 -0700 |
commit | dfd21d0e38f5f0e25bd9ccde420782f7d5faf226 (patch) | |
tree | 243d62e71c8ca2fcdb0ececa78ae8b3bdfcb53e6 | |
parent | 8fedfa3dfc72490e1fc99eb8b9b0c742ffed6e98 (diff) | |
download | async-dfd21d0e38f5f0e25bd9ccde420782f7d5faf226.tar.gz |
fix tests
-rw-r--r-- | lib/tryEach.js | 2 | ||||
-rw-r--r-- | lib/waterfall.js | 2 | ||||
-rw-r--r-- | test/auto.js | 2 | ||||
-rw-r--r-- | test/waterfall.js | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/lib/tryEach.js b/lib/tryEach.js index 87fba12..82649b4 100644 --- a/lib/tryEach.js +++ b/lib/tryEach.js @@ -52,7 +52,7 @@ export default function tryEach(tasks, callback) { result = res; } error = err; - callback(!err); + callback(err ? null : {}); }); }, function () { callback(error, result); diff --git a/lib/waterfall.js b/lib/waterfall.js index 7f5c12e..10db926 100644 --- a/lib/waterfall.js +++ b/lib/waterfall.js @@ -75,7 +75,7 @@ export default function(tasks, callback) { } function next(err/*, ...args*/) { - if (err === null) return // canceled + if (err === false) return // canceled if (err || taskIndex === tasks.length) { return callback.apply(null, arguments); } diff --git a/test/auto.js b/test/auto.js index 055cb31..48de743 100644 --- a/test/auto.js +++ b/test/auto.js @@ -210,7 +210,7 @@ describe('auto', function () { it('auto error should pass partial results', function(done) { async.auto({ task1: function(callback){ - callback(false, 'result1'); + callback(null, 'result1'); }, task2: ['task1', function(results, callback){ callback('testerror', 'result2'); diff --git a/test/waterfall.js b/test/waterfall.js index 440cb7a..8892f04 100644 --- a/test/waterfall.js +++ b/test/waterfall.js @@ -96,7 +96,7 @@ describe("waterfall", function () { async.waterfall([ function(callback){ call_order.push(1) - callback(null); + callback(false); }, function(callback){ call_order.push(2) |