Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 
Dailin 415ba84223 pre0115 il y a 4 ans
..
lib pre0115 删除 il y a 4 ans
CHANGELOG.md pre0115 il y a 4 ans
LICENSE pre0115 il y a 4 ans
README.md pre0115 il y a 4 ans
index.js pre0115 il y a 4 ans
package.json pre0115 il y a 4 ans

README.md

NPM Version GitHub Actions status Coverage Status Peer Dependencies NPM Downloads

eslint-plugin-mocha

ESLint rules for mocha.

Install and configure

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"
    ]
}

Plugin Settings

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.

Rules documentation

The documentation of the rules can be found here.