test(cloudcmd) replacePrefix

This commit is contained in:
coderaiser 2017-11-09 16:15:19 +02:00
parent cc30178aaa
commit bdb7bee0b0
2 changed files with 16 additions and 1 deletions

View file

@ -12,6 +12,7 @@ const {
_authenticate,
_getPrefix,
_authCheck,
_replacePrefix,
} = cloudcmd;
test('cloudcmd: args: no', (t) => {
@ -70,6 +71,15 @@ test('cloudcmd: getPrefix: function', (t) => {
t.end();
});
test('cloudcmd: replacePrefix', (t) => {
const url = '/hello';
const prefix = url;
const result = _replacePrefix(url, prefix);
t.equal(result, '/', 'should equal');
t.end();
});
test('cloudcmd: authCheck: success', (t) => {
const auth = config('auth');
const success = sinon.stub();