feature(cloudcmd) lib/server -> server

This commit is contained in:
coderaiser 2016-12-23 11:44:05 +02:00
parent 4b8f772538
commit 449eaf70f0
25 changed files with 31 additions and 36 deletions

47
test/server/cloudcmd.js Normal file
View file

@ -0,0 +1,47 @@
'use strict';
const test = require('tape');
const DIR = '../../server/';
const cloudcmd = require(DIR + 'cloudcmd');
const config = require(DIR + 'config');
test('cloudcmd: args: no', (t) => {
const fn = () => cloudcmd();
t.doesNotThrow(fn, /plugins should be an array!/, 'should throw when plugins not an array');
t.end();
});
test('cloudcmd: args: plugins: error', (t) => {
const fn = () => cloudcmd({
plugins: ''
});
t.throws(fn, /plugins should be an array!/, 'should throw when plugins not an array');
t.end();
});
test('cloudcmd: defaults: config', (t) => {
const configDialog = config('configDialog');
config('configDialog', false);
cloudcmd();
t.notOk(config('configDialog'), 'should not override config with defaults');
config('configDialog', configDialog);
t.end();
});
test('cloudcmd: defaults: console', (t) => {
const console = config('console');
config('console', false);
cloudcmd();
t.notOk(config('console'), 'should not override config with defaults');
config('console', console);
t.end();
});