mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
feature(util) exec: add test
This commit is contained in:
parent
18e1f4ce22
commit
e716c830d5
1 changed files with 20 additions and 0 deletions
|
|
@ -59,6 +59,26 @@
|
|||
same.should.be.false;
|
||||
});
|
||||
});
|
||||
|
||||
describe('exec', function() {
|
||||
it('should execute function with parameters', function() {
|
||||
var WORD = 'hello',
|
||||
func = function(word) {
|
||||
return word;
|
||||
},
|
||||
word = Util.exec(func, WORD);
|
||||
|
||||
WORD.should.equal(word);
|
||||
});
|
||||
|
||||
it('should not execute function, if type of first argument not function', function() {
|
||||
var WORD = 'hello',
|
||||
word = Util.exec(WORD);
|
||||
|
||||
(word === undefined).should.be.true;
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
})();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue