diff options
-rw-r--r-- | mocha_test/retry.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/mocha_test/retry.js b/mocha_test/retry.js index bed7079..57b0093 100644 --- a/mocha_test/retry.js +++ b/mocha_test/retry.js @@ -147,4 +147,14 @@ describe("retry", function () { done(); })); }); + + // note this is a synchronous test ensuring retry is synchrnous in the fastest (most straightforward) case + it('retry calls fn immediately and will call callback if successful', function() { + function fn(callback) { + callback(null, {a: 1}); + } + async.retry(5, fn, function(err, result) { + expect(result).to.be.eql({a: 1}); + }); + }) }); |