chore(cloudcmd) lint

This commit is contained in:
coderaiser 2022-06-14 14:38:11 +03:00
parent 81e76857da
commit ef10ebe97c
40 changed files with 137 additions and 134 deletions

View file

@ -5,8 +5,6 @@ const tryCatch = require('try-catch');
const DIR = __dirname + '/../../';
const COMMONDIR = DIR + 'common/';
const TMPLDIR = DIR + 'tmpl/';
const {
time,
timeEnd,
@ -17,10 +15,12 @@ const CloudFuncPath = COMMONDIR + 'cloudfunc';
const CloudFunc = require(CloudFuncPath);
const test = require('supertape');
const {reRequire} = require('mock-require');
const {reRequire} = require('mock-require');
const htmlLooksLike = require('html-looks-like');
const readFilesSync = require('@cloudcmd/read-files-sync');
const TMPLDIR = DIR + 'tmpl/';
const FS_DIR = TMPLDIR + 'fs/';
const EXPECT_PATH = __dirname + '/cloudfunc.html';

View file

@ -5,7 +5,6 @@ const {join} = require('path');
const test = require('supertape');
const rimraf = require('rimraf');
const fixtureDir = join(__dirname, '..', 'fixture') + '/';
const config = {
root: join(__dirname, '..'),
};
@ -19,6 +18,8 @@ const {request} = require('serve-once')(cloudcmd, {
configManager,
});
const fixtureDir = join(__dirname, '..', 'fixture') + '/';
test('cloudcmd: rest: copy', async (t) => {
const tmp = join(fixtureDir, 'tmp');
const files = {

View file

@ -7,8 +7,8 @@ const {Volume} = require('memfs');
const {ufs} = require('unionfs');
const mockRequire = require('mock-require');
const {reRequire, stopAll} = mockRequire;
const serveOnce = require('serve-once');
const {reRequire, stopAll} = mockRequire;
const cloudcmdPath = '../../';
const dir = cloudcmdPath + 'server/';

View file

@ -14,10 +14,9 @@ const pathTarFixture = join(__dirname, '..', 'fixture/pack.tar.gz');
const pathZipFixture = join(__dirname, '..', 'fixture/pack.zip');
const cloudcmdPath = '../..';
const fixture = {
tar: fs.readFileSync(pathTarFixture),
zip: fs.readFileSync(pathZipFixture),
};
const cloudcmd = require(cloudcmdPath);
const serveOnce = require('serve-once');
const defaultOptions = {
config: {
@ -26,9 +25,10 @@ const defaultOptions = {
},
};
const cloudcmd = require(cloudcmdPath);
const serveOnce = require('serve-once');
const fixture = {
tar: fs.readFileSync(pathTarFixture),
zip: fs.readFileSync(pathZipFixture),
};
const {request} = serveOnce(cloudcmd, defaultOptions);
const once = promisify((name, extract, fn) => {

View file

@ -7,8 +7,8 @@ const {Volume} = require('memfs');
const {ufs} = require('unionfs');
const mockRequire = require('mock-require');
const {reRequire, stopAll} = mockRequire;
const serveOnce = require('serve-once');
const {reRequire, stopAll} = mockRequire;
const cloudcmdPath = '../../';
const dir = cloudcmdPath + 'server/';

View file

@ -6,8 +6,8 @@ const {once} = require('events');
const test = require('supertape');
const io = require('socket.io-client');
const configPath = path.join(__dirname, '../..', 'server', 'config');
const {connect} = require('../before');
const configPath = path.join(__dirname, '../..', 'server', 'config');
const configFn = require(configPath).createConfig();
test('cloudcmd: console: enabled', async (t) => {

View file

@ -42,7 +42,7 @@ test('cloudcmd: modules', async (t) => {
options,
});
t.deepEqual(body, expected, 'should equal');
t.deepEqual(body, expected);
t.end();
});

View file

@ -4,14 +4,14 @@ const test = require('supertape');
const criton = require('criton');
const cloudcmd = require('..');
const configFn = cloudcmd.createConfigManager();
const config = {
auth: false,
};
const {request} = require('serve-once')(cloudcmd, {
config,
});
const configFn = cloudcmd.createConfigManager();
test('cloudcmd: static', async (t) => {
const name = 'package.json';