Skip to content

armgit / mocha

Public Imported from GitHub
0

☕️ Classic, reliable, trusted test framework for Node.js and the browser

fix ESLint problems and consolidate configuration

Christopher Hiller2d1b49c03c97
diff --git a/.eslintrc.yml b/.eslintrc.yml
index 86337ec8..ed9026ab 100644
--- a/.eslintrc.yml
+++ b/.eslintrc.yml
@@ -3,8 +3,12 @@ extends: semistandard
env:
node: yes
browser: yes
- es6: no
parserOptions:
+ ecmaVersion: 5
+ ecmaFeatures:
+ globalReturn: no
+ experimentalObjectRestSpread: no
+ jsx: no
sourceType: script
rules:
strict:
@@ -13,3 +17,26 @@ rules:
linebreak-style:
- error
- unix
+overrides:
+ - files:
+ - scripts/**/*.js
+ - package-scripts.js
+ - karma.conf.js
+ - .wallaby.js
+ - bin/*
+ parserOptions:
+ ecmaVersion: 6
+ env:
+ browser: no
+ - files:
+ - test/**/*.js
+ env:
+ mocha: yes
+ globals:
+ expect: no
+ assert: no
+ - files:
+ - doc/**/*.js
+ env:
+ node: no
+
diff --git a/bin/.eslintrc.yml b/bin/.eslintrc.yml
deleted file mode 100644
index 36e0a779..00000000
--- a/bin/.eslintrc.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-env:
- es6: true
- browser: false
diff --git a/docs/.eslintrc.yml b/docs/.eslintrc.yml
deleted file mode 100644
index 6887df39..00000000
--- a/docs/.eslintrc.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-env:
- browser: true
- node: false
diff --git a/lib/browser/.eslintrc.yml b/lib/browser/.eslintrc.yml
deleted file mode 100644
index d85f537d..00000000
--- a/lib/browser/.eslintrc.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-env:
- node: false
- browser: false
- commonjs: true
diff --git a/scripts/.eslintrc.yml b/scripts/.eslintrc.yml
deleted file mode 100644
index 36e0a779..00000000
--- a/scripts/.eslintrc.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-env:
- es6: true
- browser: false
diff --git a/test/.eslintrc.yml b/test/.eslintrc.yml
deleted file mode 100644
index 92622be7..00000000
--- a/test/.eslintrc.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-env:
- mocha: true
-globals:
- expect: false
- assert: false
-rules:
- no-unused-expressions: off
diff --git a/test/reporters/helpers.js b/test/reporters/helpers.js
index 08c96ae1..aa1af157 100644
--- a/test/reporters/helpers.js
+++ b/test/reporters/helpers.js
@@ -149,8 +149,8 @@ function makeExpectedTest (
}
module.exports = {
- createMockRunner,
- makeTest,
- createElements,
- makeExpectedTest
+ createMockRunner: createMockRunner,
+ makeTest: makeTest,
+ createElements: createElements,
+ makeExpectedTest: makeExpectedTest
};
diff --git a/test/unit/grep.spec.js b/test/unit/grep.spec.js
index 0e9b60ef..b25fbc90 100644
--- a/test/unit/grep.spec.js
+++ b/test/unit/grep.spec.js
@@ -61,7 +61,7 @@ describe('Mocha', function () {
describe('"invert" option', function () {
it('should add a Boolean to the mocha.options object', function () {
var mocha = new Mocha({ invert: true });
- expect(mocha.options.invert).to.be.ok;
+ expect(mocha.options.invert, 'to be', true);
});
});
});