diff options
author | Alexander Early <alexander.early@gmail.com> | 2015-06-27 22:28:24 -0700 |
---|---|---|
committer | Alexander Early <alexander.early@gmail.com> | 2015-06-27 22:28:24 -0700 |
commit | e37af8d1214a5e7be21d6a86615d094ef38a8eea (patch) | |
tree | e349ae8cabf7ab638f845d199334985a2895b7d4 /test/test-async.js | |
parent | 74ad21e9230c91095fe4ed8528984273dc735ec8 (diff) | |
download | async-e37af8d1214a5e7be21d6a86615d094ef38a8eea.tar.gz |
make callbacks optional in whilst and family. Closes #642
Diffstat (limited to 'test/test-async.js')
-rwxr-xr-x | test/test-async.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/test-async.js b/test/test-async.js index 11685df..52e6a17 100755 --- a/test/test-async.js +++ b/test/test-async.js @@ -2847,6 +2847,19 @@ exports['doWhilst callback params'] = function (test) { ); }; +exports['whilst optional callback'] = function (test) { + var counter = 0; + async.whilst( + function () { return counter < 2; }, + function (cb) { + counter++; + cb(); + } + ); + test.equal(counter, 2); + test.done(); +}; + exports['queue'] = { 'queue': function (test) { |