Skip to content

Commit 84177db

Browse files
committed
fix: fix eslint errors
fix eslint errors in tests
1 parent 88cb184 commit 84177db

9 files changed

+20
-21
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "A full-featured framework for building command line applications (cli) with node.js",
55
"main": "index.js",
66
"scripts": {
7-
"lint": "./node_modules/.bin/eslint lib",
7+
"lint": "./node_modules/.bin/eslint lib tests examples",
88
"test": "npm run lint && ./node_modules/mocha/bin/mocha --require ./tests/utils/bootstrap.js --full-trace --recursive -R mocha-unfunk-reporter tests/",
99
"coverage": "./node_modules/.bin/istanbul cover --include-all-sources true --print both ./node_modules/.bin/_mocha -- --require ./tests/utils/bootstrap.js -R spec --recursive tests/",
1010
"commit": "git-cz",

tests/caporal-export.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"use strict";
22

3-
/* global Program, logger, should, makeArgv, sinon */
3+
/* global Program, should */
44

55
describe("require('caporal')", () => {
66
it(`should return {new Program()}`, () => {

tests/fatal-error.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"use strict";
22

3-
/* global Program, logger, should, makeArgv, sinon */
3+
/* global Program, logger, should, sinon */
44

55
const program = new Program();
66

tests/logger.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"use strict";
22

3-
/* global Program, logger, should, makeArgv, sinon */
3+
/* global should, sinon */
44

55
const myLogger = require('../lib/logger').createLogger();
66
const stripColor = require('chalk').stripColor;

tests/no-command.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ describe('Setting up no command() but an action()', () => {
1212
.logger(logger)
1313
.version('1.0.0');
1414

15-
it(`should execute action()`, (done) => {
16-
program.action(() => {
17-
done();
18-
});
15+
it(`should execute action()`, () => {
16+
const action = sinon.stub();
17+
program.action(action);
1918
program.parse([]);
19+
should(action.callCount).eql(1);
2020
});
2121
});
2222

@@ -29,11 +29,11 @@ describe('Setting up no command() but an argument() and an action()', () => {
2929
.version('1.0.0')
3030
.argument('<foo>', 'My foo arg');
3131

32-
it(`should execute action()`, (done) => {
33-
program.action(() => {
34-
done();
35-
});
32+
it(`should execute action()`, () => {
33+
const action = sinon.stub();
34+
program.action(action);
3635
program.parse(makeArgv(['myarg']));
36+
should(action.callCount).eql(1);
3737
});
3838
});
3939

tests/utils/bootstrap.js

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
"use strict";
22

3-
//const program = global.program = require('../..');
4-
const Program = global.Program = require('../../lib/program');
5-
const should = global.should = require('should/as-function');
6-
const logger = global.logger = require('./callback-logger').logger;
7-
const makeArgv = global.makeArgv = require('./make-argv');
8-
const sinon = global.sinon = require('sinon');
3+
global.Program = require('../../lib/program');
4+
global.should = require('should/as-function');
5+
global.logger = require('./callback-logger').logger;
6+
global.makeArgv = require('./make-argv');
7+
global.sinon = require('sinon');

tests/verbosity-default.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"use strict";
22

3-
/* global Program, logger, should, makeArgv, sinon */
3+
/* global Program, logger, should, makeArgv */
44

55
const program = new Program();
66

tests/verbosity-quiet.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"use strict";
22

3-
/* global Program, logger, should, makeArgv, sinon */
3+
/* global Program, logger, should, makeArgv */
44

55
const program = new Program();
66

tests/verbosity-verbose.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"use strict";
22

3-
/* global Program, logger, should, makeArgv, sinon */
3+
/* global Program, logger, should, makeArgv */
44

55
const program = new Program();
66

0 commit comments

Comments
 (0)