mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-18 00:47:01 +00:00
chore(cloudcmd) lint
This commit is contained in:
parent
bd5a8afdd5
commit
efb686c332
12 changed files with 43 additions and 29 deletions
|
|
@ -6,7 +6,7 @@ const test = require('supertape');
|
|||
const stub = require('@cloudcmd/stub');
|
||||
const tryCatch = require('try-catch');
|
||||
const mockRequire = require('mock-require');
|
||||
const {reRequire} = mockRequire;
|
||||
const {reRequire, stopAll} = mockRequire;
|
||||
|
||||
const dir = '..';
|
||||
|
||||
|
|
@ -64,7 +64,7 @@ test('validate: root: stat', (t) => {
|
|||
const msg = 'cloudcmd --root: %s';
|
||||
fs.statSync = statSync;
|
||||
|
||||
mockRequire.stop(exitPath);
|
||||
stopAll();
|
||||
|
||||
t.calledWith(fn, [msg, error], 'should call fn');
|
||||
t.end();
|
||||
|
|
@ -80,7 +80,7 @@ test('validate: packer: not valid', (t) => {
|
|||
|
||||
packer('hello');
|
||||
|
||||
mockRequire.stop(exitPath);
|
||||
stopAll();
|
||||
|
||||
t.calledWith(fn, [msg], 'should call fn');
|
||||
t.end();
|
||||
|
|
@ -96,7 +96,7 @@ test('validate: editor: not valid', (t) => {
|
|||
|
||||
editor('hello');
|
||||
|
||||
mockRequire.stop(exitPath);
|
||||
stopAll();
|
||||
|
||||
t.calledWith(fn, [msg], 'should call fn');
|
||||
t.end();
|
||||
|
|
@ -110,7 +110,7 @@ test('validate: columns', (t) => {
|
|||
|
||||
columns('name-size-date');
|
||||
|
||||
mockRequire.stop(exitPath);
|
||||
stopAll();
|
||||
|
||||
t.notOk(fn.called, 'should not call exit');
|
||||
t.end();
|
||||
|
|
@ -130,8 +130,7 @@ test('validate: columns: wrong', (t) => {
|
|||
|
||||
columns('hello');
|
||||
|
||||
mockRequire.stop(exitPath);
|
||||
mockRequire.stop(columnsPath);
|
||||
stopAll();
|
||||
|
||||
t.calledWith(fn, [msg], 'should call exit');
|
||||
t.end();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue