Dailin 415ba84223 | 4 년 전 | ||
---|---|---|---|
.. | |||
lib | 删除 | 4 년 전 | |
CHANGELOG.md | 4 년 전 | ||
LICENSE | 4 년 전 | ||
README.md | 4 년 전 | ||
index.js | 4 년 전 | ||
package.json | 4 년 전 |
ESLint rules for mocha.
This plugin requires ESLint 4.0.0
or later.
npm install --save-dev eslint-plugin-mocha
Then add a reference to this plugin and selected rules in your eslint config:
{
"plugins": [
"mocha"
]
}
This plugin supports the following settings, which are used by multiple rules:
additionalCustomNames
: This allows rules to check additional function names when looking for suites or test cases. This might be used with a custom Mocha extension, such as ember-mocha
Example:{
"rules": {
"mocha/no-skipped-tests": "error",
"mocha/no-exclusive-tests": "error"
},
"settings": {
"mocha/additionalCustomNames": [
{ "name": "describeModule", "type": "suite", "interfaces": [ "BDD" ] },
{ "name": "testModule", "type": "testCase", "interfaces": [ "TDD" ] }
]
}
}
This plugin exports a recommended config that enforces good practices.
Enable it with the extends option:
{
"extends": [
"plugin:mocha/recommended"
]
}
See Configuring Eslint on eslint.org for more info.
The documentation of the rules can be found here.