diff --git a/index.js b/index.js index 5966797..a2c7e0a 100644 --- a/index.js +++ b/index.js @@ -88,8 +88,10 @@ if (!options.wrapper) { options.wrapper = myObject.wrapper; } - myObject.test(options.wrapper(options.fn, item), item.result); - return done(); + options.wrapper(options.fn, item, function(result){ + myObject.test(result, item.result); + return done(); + }) }); return callback(); }); @@ -97,8 +99,8 @@ } }; -myObject.wrapper = function(fn, item) { - return fn(item.arguments); +myObject.wrapper = function(fn, item, cb) { + return cb(fn(item.arguments)); }; /**