You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

eslint-plugin-mocha

Package Overview
Dependencies
Maintainers
4
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-mocha

Eslint rules for mocha.

11.1.0
latest
Source
npmnpm
Version published
Weekly downloads
1.4M
-3.51%
Maintainers
4
Weekly downloads
 
Created

What is eslint-plugin-mocha?

eslint-plugin-mocha is an ESLint plugin that provides linting rules specific to Mocha, a popular JavaScript test framework. It helps enforce best practices and coding standards for Mocha tests, ensuring consistency and reducing common errors.

What are eslint-plugin-mocha's main functionalities?

Disallow exclusive tests

This rule disallows the use of exclusive tests (e.g., `describe.only` and `it.only`) to prevent accidentally skipping other tests.

module.exports = { "rules": { "mocha/no-exclusive-tests": "error" } };

Disallow skipped tests

This rule warns against the use of skipped tests (e.g., `describe.skip` and `it.skip`) to ensure that all tests are being run.

module.exports = { "rules": { "mocha/no-skipped-tests": "warn" } };

Enforce test case titles

This rule enforces that test cases have valid descriptions, ensuring that test titles are meaningful and descriptive.

module.exports = { "rules": { "mocha/valid-test-description": "error" } };

Disallow synchronous tests

This rule disallows synchronous tests, encouraging the use of asynchronous tests to avoid blocking the event loop.

module.exports = { "rules": { "mocha/no-synchronous-tests": "error" } };

Limit the number of top-level suites

This rule limits the number of top-level suites in a test file, promoting better organization and structure of tests.

module.exports = { "rules": { "mocha/max-top-level-suites": ["error", { "limit": 1 }] } };

Other packages similar to eslint-plugin-mocha

Keywords

eslint

FAQs

Package last updated on 24 May 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts