mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-28 10:14:13 +00:00
feature(cloudcmd) lib/server -> server
This commit is contained in:
parent
4b8f772538
commit
449eaf70f0
25 changed files with 31 additions and 36 deletions
47
test/server/cloudcmd.js
Normal file
47
test/server/cloudcmd.js
Normal 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();
|
||||
});
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue