Skip to content

Commit 3030206

Browse files
committed
(test) test for multiple arguments in callbacks
1 parent 1c18b66 commit 3030206

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

test/vows-test.js

+19
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,25 @@ vows.describe("Vows").addBatch({
243243
"should work the same as returning a value": function (res) {
244244
assert.equal(res, 'hello');
245245
}
246+
},
247+
"with multiple arguments": {
248+
topic: function () {
249+
this.callback(null, 1, 2, 3);
250+
},
251+
"should pass them to the vow": function (e, a, b, c) {
252+
assert.strictEqual(e, null);
253+
assert.strictEqual(a, 1);
254+
assert.strictEqual(b, 2);
255+
assert.strictEqual(c, 3);
256+
},
257+
"and a sub-topic": {
258+
topic: function (a, b, c) {
259+
return [a, b, c];
260+
},
261+
"should receive them too": function (val) {
262+
assert.deepEqual(val, [1, 2, 3]);
263+
}
264+
}
246265
}
247266
}
248267
}).addBatch({

0 commit comments

Comments
 (0)