From c793082ec814f9f844c6bcf7b8d422aeda4b79ca Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 8 May 2018 10:32:36 +0300 Subject: [PATCH] test(terminal) enabled: no string --- test/server/terminal.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/test/server/terminal.js b/test/server/terminal.js index f6f3cfa7..db9d9e59 100644 --- a/test/server/terminal.js +++ b/test/server/terminal.js @@ -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(); });