diff options
Diffstat (limited to 'mocha_test/retry.js')
-rw-r--r-- | mocha_test/retry.js | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/mocha_test/retry.js b/mocha_test/retry.js index cc24a29..bed7079 100644 --- a/mocha_test/retry.js +++ b/mocha_test/retry.js @@ -1,6 +1,7 @@ var async = require('../lib'); var expect = require('chai').expect; var assert = require('assert'); +var _ = require('lodash'); describe("retry", function () { @@ -121,7 +122,7 @@ describe("retry", function () { }, 50); }); - it('retry does not precompute the intervals (#1226)',function(done) { + it('retry does not precompute the intervals (#1226)', function(done) { var callTimes = []; function intervalFunc() { callTimes.push(new Date().getTime()); @@ -136,4 +137,14 @@ describe("retry", function () { done(); }); }); + + it('retry passes all resolve arguments to callback', function(done) { + function fn(callback) { + callback(null, 1, 2, 3); // respond with indexed values + } + async.retry(5, fn, _.rest(function(args) { + expect(args).to.be.eql([null, 1, 2, 3]); + done(); + })); + }); }); |