1.0.3 • Published 5 years ago

tslint-plugin-jasmine v1.0.3

Weekly downloads
605
License
MIT
Repository
github
Last release
5 years ago

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:

RuleRecommendedOptions
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.