style: make eslint aware of mocha globals in plugins/mocha-tests and stack/test-runner

Also remove some `/* globals ... */` comments and supply missing semicolons
This commit is contained in:
Michael Bradley, Jr 2019-09-08 15:24:01 -05:00 committed by Michael Bradley
parent 5e8889f9de
commit 8779476ac0
4 changed files with 8 additions and 4 deletions

View File

@ -42,6 +42,9 @@
"test": "mocha dist/test/**/*.js" "test": "mocha dist/test/**/*.js"
}, },
"eslintConfig": { "eslintConfig": {
"env": {
"mocha": true
},
"extends": "../../../.eslintrc.json" "extends": "../../../.eslintrc.json"
}, },
"devDependencies": { "devDependencies": {

View File

@ -1,4 +1,3 @@
/* globals describe, it */
const assert = require('assert').strict; const assert = require('assert').strict;
const refute = require('refute')(assert); const refute = require('refute')(assert);
const sinon = require('sinon'); const sinon = require('sinon');

View File

@ -44,6 +44,9 @@
"test": "mocha dist/test/**/*.js" "test": "mocha dist/test/**/*.js"
}, },
"eslintConfig": { "eslintConfig": {
"env": {
"mocha": true
},
"extends": "../../../.eslintrc.json" "extends": "../../../.eslintrc.json"
}, },
"dependencies": { "dependencies": {

View File

@ -1,4 +1,3 @@
/* globals describe, it */
const assert = require('assert').strict; const assert = require('assert').strict;
const refute = require('refute')(assert); const refute = require('refute')(assert);
const sinon = require('sinon'); const sinon = require('sinon');
@ -39,13 +38,13 @@ describe('Test Runner', () => {
instance.runners = [first, second]; instance.runners = [first, second];
instance.getFilesFromDir = (_, cb) => { instance.getFilesFromDir = (_, cb) => {
cb(null, ['test/file_first.js', 'test/file_second.js']); cb(null, ['test/file_first.js', 'test/file_second.js']);
} };
}); });
it('should warn when a file does not match any plugins', (done) => { it('should warn when a file does not match any plugins', (done) => {
instance.getFilesFromDir = (_, cb) => { instance.getFilesFromDir = (_, cb) => {
cb(null, ['luri.js']); cb(null, ['luri.js']);
} };
instance.run({}, (err) => { instance.run({}, (err) => {
// Ensure no error was returned // Ensure no error was returned