summaryrefslogtreecommitdiff
path: root/test/test-async.js
diff options
context:
space:
mode:
authorAlexander Early <alexander.early@gmail.com>2015-06-27 22:28:24 -0700
committerAlexander Early <alexander.early@gmail.com>2015-06-27 22:28:24 -0700
commite37af8d1214a5e7be21d6a86615d094ef38a8eea (patch)
treee349ae8cabf7ab638f845d199334985a2895b7d4 /test/test-async.js
parent74ad21e9230c91095fe4ed8528984273dc735ec8 (diff)
downloadasync-e37af8d1214a5e7be21d6a86615d094ef38a8eea.tar.gz
make callbacks optional in whilst and family. Closes #642
Diffstat (limited to 'test/test-async.js')
-rwxr-xr-xtest/test-async.js13
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) {