Socket
Socket
Sign inDemoInstall

eslint-plugin-mocha

Package Overview
Dependencies
Maintainers
4
Versions
63
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.


Version published
Maintainers
4
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

FAQs

Package last updated on 16 Feb 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc