Socket
Socket
Sign inDemoInstall

eslint-plugin-jasmine

Package Overview
Dependencies
1
Maintainers
1
Versions
54
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-jasmine


Version published
Maintainers
1
Created

Package description

What is eslint-plugin-jasmine?

eslint-plugin-jasmine is an ESLint plugin that provides linting rules specific to Jasmine, a popular testing framework for JavaScript. This plugin helps ensure that Jasmine tests follow best practices and maintain consistency.

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

no-focused-tests

This rule disallows the use of focused tests (e.g., `fit` and `fdescribe`) to prevent accidentally committing them.

module.exports = {
  "rules": {
    "jasmine/no-focused-tests": "error"
  }
};

no-disabled-tests

This rule warns against the use of disabled tests (e.g., `xdescribe` and `xit`) to ensure that all tests are active.

module.exports = {
  "rules": {
    "jasmine/no-disabled-tests": "warn"
  }
};

no-suite-dupes

This rule prevents the creation of duplicate test suite names, which can cause confusion and errors in test reporting.

module.exports = {
  "rules": {
    "jasmine/no-suite-dupes": "error"
  }
};

no-spec-dupes

This rule prevents the creation of duplicate test spec names within a suite, ensuring each test is unique and easily identifiable.

module.exports = {
  "rules": {
    "jasmine/no-spec-dupes": ["error", "branch"]
  }
};

prefer-toHaveBeenCalledWith

This rule encourages the use of `toHaveBeenCalledWith` over `toHaveBeenCalled` to make assertions more specific and meaningful.

module.exports = {
  "rules": {
    "jasmine/prefer-toHaveBeenCalledWith": "warn"
  }
};

Other packages similar to eslint-plugin-jasmine

Readme

Source

eslint-plugin-jasmine

Build Status

ESLint rules for Jasmine

Usage

  1. Install eslint-plugin-jasmine as a dev-dependency:

    npm install --save-dev eslint-plugin-jasmine
    
  2. Enable the plugin by adding it to your .eslintrc:

    plugins:
      - jasmine
    

Configuration

This plugin ships with a default configuration for each rule:

RuleDefault
no-focused-tests2
no-disabled-tests1
no-suite-dupes1

For example, the no-focused-tests rule is enabled by default and will cause ESLint to throw an error (with an exit code of 1) when triggered.

You may customise each rule by adding a value in your .eslintrc rules property:

plugins:
  - jasmine
rules:
  jasmine/no-focused-tests: 0

See configuring rules for more information.

Author

© 2015 Tom Vincent git@tlvince.com

License

Licensed under the MIT license.

Keywords

FAQs

Last updated on 12 Jul 2015

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc