mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
test(rest) getWin32RootMsg
This commit is contained in:
parent
38291f1fc3
commit
35b954ab46
2 changed files with 12 additions and 2 deletions
|
|
@ -356,6 +356,8 @@ function isRootAll(names) {
|
|||
});
|
||||
}
|
||||
|
||||
module.exports._getWin32RootMsg = getWin32RootMsg;
|
||||
|
||||
function getWin32RootMsg() {
|
||||
const message = 'Could not copy from/to root on windows!';
|
||||
const error = Error(message);
|
||||
|
|
|
|||
|
|
@ -4,12 +4,13 @@ const test = require('tape');
|
|||
const rest = require('../../server/rest');
|
||||
const {
|
||||
_formatMsg,
|
||||
_getWin32RootMsg,
|
||||
} = rest;
|
||||
|
||||
test('rest: formatMsg', (t) => {
|
||||
const result = _formatMsg('hello', 'world');
|
||||
|
||||
t.equal(result, 'hello: ok("world")');
|
||||
t.equal(result, 'hello: ok("world")', 'should be equal');
|
||||
t.end();
|
||||
});
|
||||
|
||||
|
|
@ -18,7 +19,14 @@ test('rest: formatMsg: json', (t) => {
|
|||
name: 'world',
|
||||
});
|
||||
|
||||
t.equal(result, 'hello: ok("{"name":"world"}")');
|
||||
t.equal(result, 'hello: ok("{"name":"world"}")', 'should parse json');
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('rest: getWin32RootMsg', (t) => {
|
||||
const {message}= _getWin32RootMsg();
|
||||
|
||||
t.equal(message,'Could not copy from\/to root on windows!', 'should return error');
|
||||
t.end();
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue