diff options
author | Graeme Yeates <yeatesgraeme@gmail.com> | 2015-08-01 17:48:49 -0400 |
---|---|---|
committer | Graeme Yeates <yeatesgraeme@gmail.com> | 2015-08-01 17:48:49 -0400 |
commit | d9b860d666fd79498a45268c47bfd964c2fabefd (patch) | |
tree | a1799f2667eb8d41f44db8cc2714420e920d2995 /test/test-async.js | |
parent | 0574aa90d696e22e5c870192ba8ec22e4e0e9eb2 (diff) | |
download | async-d9b860d666fd79498a45268c47bfd964c2fabefd.tar.gz |
Implement each as iteratoreach-iter
Diffstat (limited to 'test/test-async.js')
-rwxr-xr-x | test/test-async.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/test/test-async.js b/test/test-async.js index 23aa2b9..59ff438 100755 --- a/test/test-async.js +++ b/test/test-async.js @@ -1353,8 +1353,7 @@ exports['forEachOf empty object'] = function(test){ test.ok(false, 'iterator should not be called'); callback(); }, function(err) { - if (err) throw err; - test.ok(true, 'should call callback'); + test.same(err, null, 'should call callback with err'); }); setTimeout(test.done, 25); }; @@ -1365,8 +1364,7 @@ exports['forEachOf empty array'] = function(test){ test.ok(false, 'iterator should not be called'); callback(); }, function(err) { - if (err) throw err; - test.ok(true, 'should call callback'); + test.same(err, null, 'should call callback with err'); }); setTimeout(test.done, 25); }; @@ -1765,6 +1763,7 @@ exports['map'] = { async.map(a, function(x, callback){ callback(null, x*2); }, function(err, results){ + console.log(results, [2, 4, 6]); test.same(results, [2,4,6]); test.same(a, [1,2,3]); test.done(); @@ -2034,6 +2033,7 @@ exports['filter'] = function(test){ exports['filter original untouched'] = function(test){ var a = [3,1,2]; async.filter(a, function(x, callback){ + console.log(x); callback(x % 2); }, function(results){ test.same(results, [3,1]); @@ -2071,10 +2071,11 @@ exports['reject original untouched'] = function(test){ test.expect(2); var a = [3,1,2]; async.reject(a, function(x, callback){ + console.log(x); callback(x % 2); }, function(results){ test.same(results, [2]); - test.same(a, [3,1,2]); + test.same(a, [3, 1, 2]); test.done(); }); }; |