diff --git a/test/lib/util.js b/test/lib/util.js index 5cb6aab1..323faee3 100644 --- a/test/lib/util.js +++ b/test/lib/util.js @@ -79,6 +79,27 @@ }); }); + describe('asyncCall', function() { + it('should execute a couple functions async and return results in callback', function() { + var WORD = 'hello world', + funcSlow = function(callback) { + setTimeout(function() { + Util.exec(callback, 'hello'); + }, 10); + }, + funcFast = function(callback) { + setTimeout(function() { + Util.exec(callback, 'world'); + }, 1); + }; + + Util.asyncCall([funcSlow, funcFast], function(hello, world) { + WORD.should.equal(hello + ' ' + world); + }); + }); + + }); + }); })();