
Security News
Google’s OSV Fix Just Added 500+ New Advisories — All Thanks to One Small Policy Change
A data handling bug in OSV.dev caused disputed CVEs to disappear from vulnerability feeds until a recent fix restored over 500 advisories.
eslint-plugin-jasmine
Advanced tools
ESLint rules for Jasmine
Install eslint-plugin-jasmine
as a dev-dependency:
npm install --save-dev eslint-plugin-jasmine
Enable the plugin by adding it to your .eslintrc
:
plugins:
- jasmine
ESLint itself provides a Jasmine environment for Jasmine's global
variables. It's therefore recommended to also enable it in your .eslintrc
:
plugins:
- jasmine
env:
jasmine: true
By default, no rules are enabled. See the next section for more.
This plugin exports a recommended
configuration that enforces good practices.
To enable this configuration, use the extends
property in your .eslintrc
config file:
plugins:
- jasmine
env:
jasmine: true
extends: "plugin:jasmine/recommended"
See the ESLint config docs for more information about extending configuration files.
Rule | Recommended | Options |
---|---|---|
expect-matcher | 1, | |
expect-single-argument | 1, | |
missing-expect | 0, 'expect()' , 'expectAsync()' | expectation function names |
named-spy | 0 | |
new-line-before-expect | 1 | |
new-line-between-declarations | 1 | |
no-assign-spyon | 0 | |
no-describe-variables | 0 | |
no-disabled-tests | 1 | |
no-expect-in-setup-teardown | 1, 'expect()' , 'expectAsync()' | expectation function names |
no-focused-tests | 2 | |
no-global-setup | 2 | |
no-pending-tests | 1 | |
no-promise-without-done-fail | 1 | |
no-spec-dupes | 1, 'block' | ['block', 'branch'] |
no-suite-callback-args | 2 | |
no-suite-dupes | 1, 'block' | ['block', 'branch'] |
no-unsafe-spy | 1 | |
valid-expect | deprecated | |
prefer-jasmine-matcher | 1 | |
prefer-promise-strategies | 1 | |
prefer-toHaveBeenCalledWith | 1 | |
prefer-toBeUndefined | 0 | ['always', 'never'] |
For example, using the recommended configuration, the no-focused-tests
rule
is enabled 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
env:
jasmine: true
rules:
jasmine/no-focused-tests: 0
jasmine/no-suite-dupes:
- 2
- branch
See configuring rules for more information.
© 2016 - 2017 Tom Vincent git@tlvince.com and contributors.
Released under the MIT license.
eslint-plugin-jest is an ESLint plugin for Jest, another popular testing framework. It provides similar linting rules to ensure best practices and consistency in Jest tests. While eslint-plugin-jasmine is tailored for Jasmine, eslint-plugin-jest is specifically designed for Jest.
eslint-plugin-mocha is an ESLint plugin for Mocha, a feature-rich JavaScript test framework. It offers linting rules to enforce best practices and consistency in Mocha tests. Like eslint-plugin-jasmine, it focuses on a specific testing framework, but for Mocha instead of Jasmine.
eslint-plugin-qunit is an ESLint plugin for QUnit, a powerful, easy-to-use JavaScript unit testing framework. It provides linting rules to ensure best practices and consistency in QUnit tests. This plugin is similar to eslint-plugin-jasmine but is designed for QUnit.
FAQs
ESLint rules for Jasmine
The npm package eslint-plugin-jasmine receives a total of 147,386 weekly downloads. As such, eslint-plugin-jasmine popularity was classified as popular.
We found that eslint-plugin-jasmine demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
A data handling bug in OSV.dev caused disputed CVEs to disappear from vulnerability feeds until a recent fix restored over 500 advisories.
Research
/Security News
175 malicious npm packages (26k+ downloads) used unpkg CDN to host redirect scripts for a credential-phishing campaign targeting 135+ organizations worldwide.
Security News
Python 3.14 adds template strings, deferred annotations, and subinterpreters, plus free-threaded mode, an experimental JIT, and Sigstore verification.