summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormegawac <megawac@gmail.com>2015-07-20 00:29:54 -0400
committermegawac <megawac@gmail.com>2015-07-20 00:29:54 -0400
commitc98a7a8679f403867225fa6d6718af5df7dae75c (patch)
treeaacae319569af8a79222f5fe2fb73d5ce61abe65
parentca18d4c8be52a1050da97491fb8e32827afdb81f (diff)
downloadasync-c98a7a8679f403867225fa6d6718af5df7dae75c.tar.gz
Test coverage for *whilst and *during
-rwxr-xr-xtest/test-async.js50
1 files changed, 50 insertions, 0 deletions
diff --git a/test/test-async.js b/test/test-async.js
index 75f1a3e..bea0ea9 100755
--- a/test/test-async.js
+++ b/test/test-async.js
@@ -2969,6 +2969,22 @@ exports['doWhilst callback params'] = function (test) {
);
};
+exports['doWhilst - error'] = function (test) {
+ test.expect(1);
+ var error = new Error('asdas');
+
+ async.doWhilst(
+ function (cb) {
+ cb(error);
+ },
+ function () {},
+ function (err) {
+ test.equal(err, error);
+ test.done();
+ }
+ );
+};
+
exports['during'] = function (test) {
var call_order = [];
@@ -3028,6 +3044,40 @@ exports['doDuring'] = function (test) {
);
};
+exports['doDuring - error test'] = function (test) {
+ test.expect(1);
+ var error = new Error('asdas');
+
+ async.doDuring(
+ function (cb) {
+ cb(error);
+ },
+ function () {},
+ function (err) {
+ test.equal(err, error);
+ test.done();
+ }
+ );
+};
+
+exports['doDuring - error iterator'] = function (test) {
+ test.expect(1);
+ var error = new Error('asdas');
+
+ async.doDuring(
+ function (cb) {
+ cb(null);
+ },
+ function (cb) {
+ cb(error);
+ },
+ function (err) {
+ test.equal(err, error);
+ test.done();
+ }
+ );
+};
+
exports['whilst optional callback'] = function (test) {
var counter = 0;
async.whilst(