Skip to content
This repository has been archived by the owner on Mar 20, 2019. It is now read-only.

TaylorBriggs/tslint-plugin-jasmine

 
 

Repository files navigation

npm version Build Status semantic-release

tslint-plugin-jasmine

TSLint rules for Jasmine

Usage

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

    npm install --save-dev tslint-plugin-jasmine
  2. Enable the rules by adding it to your tslint.json:

{
  "extends": [
    // ...other rules
    "tslint-plugin-jasmine"
  ],
  "rules": {
    // enable/disable rules
  }
}

Rules

No rules are enabled by default. You can use the recommended configuration:

Rule Recommended Options
expect-matcher { "severity": "warning" }
expect-single-argument { "severity": "warning" }
missing-expect { "severity": "off", "options": ["expect()", "expectAsync()"] } expectation function names
named-spy { "severity": "off" }
new-line-before-expect { "severity": "warning" }
new-line-between-declarations { "severity": "warning" }
no-assign-spyon { "severity": "off" }
no-describe-variables { "severity": "off" }
no-disabled-tests { "severity": "warning" }
no-expect-in-setup-teardown { "severity": "warning", "options" ["expect()", "expectAsync()"] } expectation function names
no-focused-tests { "severity": "error" }
no-global-setup { "severity": "error" }
no-promise-without-done-fail { "severity": "warning" }
no-spec-dupes { "severity": "warning" } 'branch'
no-suite-callback-args { "severity": "error" }
no-suite-dupes { "severity": "warning" } 'branch'
no-unsafe-spy { "severity": "warning" }
prefer-jasmine-matcher { "severity": "warning" }
prefer-to-have-been-called-with { "severity": "warning" }

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

License

Released under the MIT license.

Packages

No packages published

Languages

  • JavaScript 97.0%
  • Shell 1.9%
  • TypeScript 1.1%