MCPcopy
hub / github.com/caolan/async / fn

Function fn

mocha_test/retry.js:13–18  ·  view source on GitHub ↗
(callback)

Source from the content-addressed store, hash-verified

11 var callCount = 0;
12 var expectedResult = 'success';
13 function fn(callback) {
14 callCount++;
15 failed--;
16 if (!failed) callback(null, expectedResult);
17 else callback(true); // respond with error
18 }
19 async.retry(fn, function(err, result){
20 assert(err === null, err + " passed instead of 'null'");
21 assert.equal(callCount, 3, 'did not retry the correct number of times');

Callers 7

taskCompleteFunction · 0.50
doSeriesFunction · 0.50
doParallelLimitFunction · 0.50
concatFunction · 0.50
doParallelFunction · 0.50
doLimitFunction · 0.50
asyncFunctions.jsFile · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected