mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-18 00:47:01 +00:00
chore(cloudcmd) lint
This commit is contained in:
parent
bd5a8afdd5
commit
efb686c332
12 changed files with 43 additions and 29 deletions
|
|
@ -9,6 +9,8 @@ const terminalPath = './terminal';
|
|||
const terminal = require('./terminal');
|
||||
const {createConfigManager} = require('./cloudcmd');
|
||||
|
||||
const {stopAll} = mockRequire;
|
||||
|
||||
test('cloudcmd: terminal: disabled', (t) => {
|
||||
const config = createConfigManager();
|
||||
config('terminal', false);
|
||||
|
|
@ -38,6 +40,8 @@ test('cloudcmd: terminal: enabled', (t) => {
|
|||
const terminal = require(terminalPath);
|
||||
terminal(arg);
|
||||
|
||||
stopAll();
|
||||
|
||||
t.calledWith(term, [arg], 'should call terminal');
|
||||
t.end();
|
||||
});
|
||||
|
|
@ -67,12 +71,13 @@ test('cloudcmd: terminal: no arg', (t) => {
|
|||
|
||||
mockRequire('gritty', gritty);
|
||||
const config = createConfigManager();
|
||||
|
||||
config('terminal', true);
|
||||
config('terminalPath', 'gritty');
|
||||
|
||||
const result = terminal(config);
|
||||
|
||||
mockRequire.stop('gritty');
|
||||
stopAll();
|
||||
|
||||
t.equal(result, gritty);
|
||||
t.end();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue