mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
chore: lint
This commit is contained in:
parent
8e25a02568
commit
88da092fdb
38 changed files with 125 additions and 124 deletions
|
|
@ -3,14 +3,14 @@
|
|||
const fs = require('fs');
|
||||
const tryCatch = require('try-catch');
|
||||
|
||||
const DIR = __dirname + '/../../';
|
||||
const COMMONDIR = DIR + 'common/';
|
||||
const DIR = `${__dirname}/../../`;
|
||||
const COMMONDIR = `${DIR}common/`;
|
||||
const {
|
||||
time,
|
||||
timeEnd,
|
||||
} = require(COMMONDIR + 'util');
|
||||
} = require(`${COMMONDIR}util`);
|
||||
|
||||
const CloudFuncPath = COMMONDIR + 'cloudfunc';
|
||||
const CloudFuncPath = `${COMMONDIR}cloudfunc`;
|
||||
|
||||
const CloudFunc = require(CloudFuncPath);
|
||||
|
||||
|
|
@ -20,10 +20,10 @@ const {reRequire} = require('mock-require');
|
|||
const htmlLooksLike = require('html-looks-like');
|
||||
|
||||
const readFilesSync = require('@cloudcmd/read-files-sync');
|
||||
const TMPLDIR = DIR + 'tmpl/';
|
||||
const TMPLDIR = `${DIR}tmpl/`;
|
||||
|
||||
const FS_DIR = TMPLDIR + 'fs/';
|
||||
const EXPECT_PATH = __dirname + '/cloudfunc.html';
|
||||
const FS_DIR = `${TMPLDIR}fs/`;
|
||||
const EXPECT_PATH = `${__dirname}/cloudfunc.html`;
|
||||
|
||||
const addHBS = (a) => `${a}.hbs`;
|
||||
const TMPL = [
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@ const serveOnce = require('serve-once');
|
|||
const {reRequire, stopAll} = mockRequire;
|
||||
|
||||
const cloudcmdPath = '../../';
|
||||
const dir = cloudcmdPath + 'server/';
|
||||
const restPath = dir + 'rest';
|
||||
const dir = `${cloudcmdPath}server/`;
|
||||
const restPath = `${dir}rest`;
|
||||
|
||||
const {assign} = Object;
|
||||
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ test('cloudcmd: rest: pack: tar: get', async (t) => {
|
|||
|
||||
const [, stream] = await once('entry', extract);
|
||||
const data = await pullout(stream);
|
||||
const file = fs.readFileSync(__dirname + '/../fixture/pack', 'utf8');
|
||||
const file = fs.readFileSync(`${__dirname}/../fixture/pack`, 'utf8');
|
||||
|
||||
t.equal(file, data, 'should pack data');
|
||||
t.end();
|
||||
|
|
@ -76,7 +76,7 @@ test('cloudcmd: rest: pack: tar: put: file', async (t) => {
|
|||
config,
|
||||
};
|
||||
|
||||
const name = String(Math.random()) + '.tar.gz';
|
||||
const name = `${Math.random()}.tar.gz`;
|
||||
|
||||
const {request} = serveOnce(cloudcmd, defaultOptions);
|
||||
|
||||
|
|
@ -92,7 +92,7 @@ test('cloudcmd: rest: pack: tar: put: file', async (t) => {
|
|||
|
||||
const [, stream] = await once('entry', extract);
|
||||
const data = await pullout(stream, 'buffer');
|
||||
const result = fs.readFileSync(__dirname + '/../fixture/pack');
|
||||
const result = fs.readFileSync(`${__dirname}/../fixture/pack`);
|
||||
|
||||
fs.unlinkSync(`${__dirname}/../${name}`);
|
||||
|
||||
|
|
@ -109,7 +109,7 @@ test('cloudcmd: rest: pack: tar: put: response', async (t) => {
|
|||
config,
|
||||
};
|
||||
|
||||
const name = String(Math.random()) + '.tar.gz';
|
||||
const name = `${Math.random()}.tar.gz`;
|
||||
const {body} = await request.put(`/api/v1/pack`, {
|
||||
options,
|
||||
body: getPackOptions(name),
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@ const serveOnce = require('serve-once');
|
|||
const {reRequire, stopAll} = mockRequire;
|
||||
|
||||
const cloudcmdPath = '../../';
|
||||
const dir = cloudcmdPath + 'server/';
|
||||
const restPath = dir + 'rest';
|
||||
const dir = `${cloudcmdPath}server/`;
|
||||
const restPath = `${dir}rest`;
|
||||
|
||||
test('cloudcmd: rest: rename', async (t) => {
|
||||
const volume = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue