mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
chore: lint
This commit is contained in:
parent
f1279666b5
commit
4717e035ee
173 changed files with 1388 additions and 1627 deletions
|
|
@ -7,6 +7,7 @@ const columnsPath = '../../server/columns';
|
|||
|
||||
test('columns: prod', (t) => {
|
||||
const {NODE_ENV} = process.env;
|
||||
|
||||
process.env.NODE_ENV = '';
|
||||
const columns = reRequire(columnsPath);
|
||||
|
||||
|
|
@ -18,6 +19,7 @@ test('columns: prod', (t) => {
|
|||
|
||||
test('columns: dev', (t) => {
|
||||
const {NODE_ENV} = process.env;
|
||||
|
||||
process.env.NODE_ENV = 'development';
|
||||
|
||||
const columns = reRequire(columnsPath);
|
||||
|
|
@ -28,4 +30,3 @@ test('columns: dev', (t) => {
|
|||
t.equal(columns['name-size-date'], css);
|
||||
t.end();
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,9 @@ test('cloudcmd: console: enabled', async (t) => {
|
|||
console: true,
|
||||
};
|
||||
|
||||
const {port, done} = await connect({config});
|
||||
const {port, done} = await connect({
|
||||
config,
|
||||
});
|
||||
const socket = io(`http://localhost:${port}/console`);
|
||||
|
||||
socket.emit('auth', configFn('username'), configFn('password'));
|
||||
|
|
@ -34,7 +36,9 @@ test('cloudcmd: console: disabled', async (t) => {
|
|||
console: false,
|
||||
};
|
||||
|
||||
const {port, done} = await connect({config});
|
||||
const {port, done} = await connect({
|
||||
config,
|
||||
});
|
||||
const socket = io(`http://localhost:${port}/console`);
|
||||
|
||||
const [error] = await once(socket, 'connect_error');
|
||||
|
|
@ -45,4 +49,3 @@ test('cloudcmd: console: disabled', async (t) => {
|
|||
t.equal(error.message, 'Invalid namespace', 'should emit error');
|
||||
t.end();
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ test('env: bool: true', (t) => {
|
|||
|
||||
test('env: bool: undefined', (t) => {
|
||||
const {cloudcmd_terminal} = process.env;
|
||||
|
||||
process.env.cloudcmd_terminal = undefined;
|
||||
|
||||
t.notOk(env.bool('terminal'), 'should be undefined');
|
||||
|
|
@ -45,4 +46,3 @@ test('env: bool: undefined', (t) => {
|
|||
process.env.cloudcmd_terminal = cloudcmd_terminal;
|
||||
t.end();
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,7 @@
|
|||
'use strict';
|
||||
|
||||
const {join} = require('path');
|
||||
const {
|
||||
test,
|
||||
stub,
|
||||
} = require('supertape');
|
||||
const {test, stub} = require('supertape');
|
||||
|
||||
const cloudcmdPath = join(__dirname, '..', '..');
|
||||
const modulesPath = join(cloudcmdPath, 'json', 'modules.json');
|
||||
|
|
@ -28,6 +25,7 @@ test('cloudcmd: modules', async (t) => {
|
|||
},
|
||||
},
|
||||
};
|
||||
|
||||
const options = {
|
||||
modules,
|
||||
};
|
||||
|
|
@ -74,9 +72,10 @@ test('cloudcmd: modules: no', (t) => {
|
|||
const url = '/json/modules.json';
|
||||
const send = stub();
|
||||
|
||||
fn({url}, {send});
|
||||
fn({url}, {
|
||||
send,
|
||||
});
|
||||
|
||||
t.calledWith(send, [localModules], 'should have been called with modules');
|
||||
t.end();
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -38,4 +38,3 @@ test('cloudcmd: show-config: return', (t) => {
|
|||
t.equal(showConfig(config), result, 'should return table');
|
||||
t.end();
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue