mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
47 lines
1.1 KiB
JavaScript
47 lines
1.1 KiB
JavaScript
'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();
|
|
});
|
|
|