mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
test(terminal) enabled: no string
This commit is contained in:
parent
1b7811c185
commit
c793082ec8
1 changed files with 10 additions and 10 deletions
|
|
@ -61,20 +61,20 @@ test('cloudcmd: terminal: enabled', (t) => {
|
|||
});
|
||||
|
||||
test('cloudcmd: terminal: enabled: no string', (t) => {
|
||||
const {log} = console;
|
||||
console.log = sinon.stub();
|
||||
const {log:originalLog} = console;
|
||||
const log = sinon.stub();
|
||||
|
||||
clean(terminalPath);
|
||||
stub(configPath, () => true);
|
||||
|
||||
const terminal = require(terminalPath);
|
||||
terminal();
|
||||
|
||||
const msg = 'cloudcmd --terminal: path must be a string';
|
||||
|
||||
t.ok(console.log.calledWith(msg), 'should call exit');
|
||||
stub(configPath, () => 'hello');
|
||||
|
||||
console.log = log;
|
||||
const terminal = require(terminalPath);
|
||||
terminal();
|
||||
console.log = originalLog;
|
||||
|
||||
const msg = 'cloudcmd --terminal: Cannot find module \'hello\'';
|
||||
|
||||
t.ok(log.calledWith(msg), 'should call exit');
|
||||
|
||||
t.end();
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue