feature(util) asyncCall: add test

This commit is contained in:
coderaiser 2014-05-21 07:18:31 -04:00
parent f41f3974a4
commit b6d8b1a297

View file

@ -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);
});
});
});
});
})();