describe('#invokeCallback', function () { it('should invoke the function with the parameters', function () { let p1 = 1, p2 = 'str'; let func = function (arg1: number, arg2: string) { p1.should.equal(arg1); p2.should.equal(arg2); }; utils.invokeCallback(func, p1, p2); }); it('should ok if cb is null', function () { let p1 = 1, p2 = 'str'; (function () { utils.invokeCallback(null, p1, p2); }).should.not.throw(); }); });
describe('#listUserRemoteDir', function () { it('should return sub-direcotry name list of servers/ directory', function () { let expectNames = ['connector', 'area']; let p = pathUtil.listUserRemoteDir(mockBase); should.exist(p); expectNames.length.should.equal(p.length); for (let i = 0, l = expectNames.length; i < l; i++) { p.should.containEql(expectNames[i]); } }); it('should throw err if the servers/ illegal', function () { (function () { pathUtil.listUserRemoteDir('some illegal base'); }).should.throw(); }); });
describe('#listUserRemoteDir', function () { it('should return sub-direcotry name list of servers/ directory', function () { let expectNames = ['connector', 'area']; let p = pathUtil.listUserRemoteDir(mockBase); should.exist(p); expectNames.length.should.equal(p.length); for (let i = 0, l = expectNames.length; i < l; i++) { p.should.containEql(expectNames[i]); } }); it('should throw err if the servers/ illegal', function () { (function () { pathUtil.listUserRemoteDir('some illegal base'); }).should.throw(); }); });
describe('#invokeCallback', function () { it('should invoke the function with the parameters', function () { let p1 = 1, p2 = 'str'; let func = function (arg1: number, arg2: string) { p1.should.equal(arg1); p2.should.equal(arg2); }; utils.invokeCallback(func, p1, p2); }); it('should ok if cb is null', function () { let p1 = 1, p2 = 'str'; (function () { utils.invokeCallback(null, p1, p2); }).should.not.throw(); }); });