mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
test(util) add exec.ret
This commit is contained in:
parent
7332c7b325
commit
89cc120017
1 changed files with 16 additions and 0 deletions
|
|
@ -79,6 +79,22 @@
|
|||
});
|
||||
});
|
||||
|
||||
describe('exec.ret', function() {
|
||||
it('should return function that try to call callback', function() {
|
||||
var STR = 'hello world',
|
||||
func1 = function() {
|
||||
var args = Util.slice(arguments);
|
||||
|
||||
return args.join(' ');
|
||||
},
|
||||
func2 = Util.exec.ret(func1, 'hello'),
|
||||
str = func2('world');
|
||||
|
||||
str.should.be.equal(STR);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('exec.parallel', function() {
|
||||
it('should execute a couple functions async and return results in callback', function() {
|
||||
var WORD = 'hello world',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue