test(cloudcmd) getPrefix

This commit is contained in:
coderaiser 2017-11-08 17:40:14 +02:00
parent 10255164d5
commit 016b5c79f9
2 changed files with 22 additions and 8 deletions

View file

@ -8,7 +8,10 @@ const currify = require('currify');
const DIR = '../../server/';
const cloudcmd = require(DIR + 'cloudcmd');
const config = require(DIR + 'config');
const {_authenticate} = cloudcmd;
const {
_authenticate,
_getPrefix,
} = cloudcmd;
test('cloudcmd: args: no', (t) => {
const fn = () => cloudcmd();
@ -49,6 +52,15 @@ test('cloudcmd: defaults: console', (t) => {
t.end();
});
test('cloudcmd: getPrefix', (t) => {
const value = 'hello';
const fn = () => value;
const result = _getPrefix(fn);
t.equal(result, value, 'should equal')
t.end();
});
test('cloudcmd: authenticate: reject', (t) => {
const success = sinon.stub();
const emit = sinon.stub();