mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
chore(cloudcmd) lint
This commit is contained in:
parent
81e76857da
commit
ef10ebe97c
40 changed files with 137 additions and 134 deletions
|
|
@ -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';
|
||||
|
|
|
|||
|
|
@ -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 = {
|
||||
|
|
|
|||
|
|
@ -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/';
|
||||
|
|
|
|||
|
|
@ -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) => {
|
||||
|
|
|
|||
|
|
@ -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/';
|
||||
|
|
|
|||
|
|
@ -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) => {
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ test('cloudcmd: modules', async (t) => {
|
|||
options,
|
||||
});
|
||||
|
||||
t.deepEqual(body, expected, 'should equal');
|
||||
t.deepEqual(body, expected);
|
||||
t.end();
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue