1.0.3 • Published 7 years ago
tslint-plugin-jasmine v1.0.3
tslint-plugin-jasmine
TSLint rules for Jasmine
Usage
Install
tslint-plugin-jasmineas a dev dependency:npm install --save-dev tslint-plugin-jasmineEnable 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.