mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-26 17:29:27 +00:00
fix(cloudcmd) --console, --config-dialog: defaults
This commit is contained in:
parent
e8f91f4908
commit
eddb8bec4a
4 changed files with 44 additions and 9 deletions
|
|
@ -5,6 +5,19 @@ const io = require('socket.io-client');
|
|||
|
||||
const before = require('./before');
|
||||
|
||||
test('cloudcmd: console: enabled by default', (t) => {
|
||||
before({}, (port, after) => {
|
||||
const socket = io(`http://localhost:${port}/console`)
|
||||
|
||||
socket.once('data', (data) => {
|
||||
socket.close();
|
||||
t.equal(data, 'client #1 console connected\n', 'should emit data event');
|
||||
after();
|
||||
t.end();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
test('cloudcmd: console: enabled', (t) => {
|
||||
const config = {console: true};
|
||||
|
||||
|
|
|
|||
|
|
@ -99,3 +99,22 @@ test('cloudcmd: rest: config: patch: no configDialog: statusCode', (t) => {
|
|||
});
|
||||
});
|
||||
|
||||
test('cloudcmd: rest: config: enabled by default', (t) => {
|
||||
before({}, (port, after) => {
|
||||
const json = {
|
||||
auth: false,
|
||||
};
|
||||
|
||||
patch(`http://localhost:${port}/api/v1/config`, json)
|
||||
.then(warp(_pullout, 'string'))
|
||||
.then((result) => {
|
||||
t.equal(result, 'config: ok("auth")', 'should patch config');
|
||||
t.end();
|
||||
after();
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue