eslint-plugin-jasmine
Advanced tools
Comparing version 1.8.1 to 1.9.0
@@ -13,3 +13,4 @@ 'use strict' | ||
'valid-expect': require('./lib/rules/valid-expect'), | ||
'no-assign-spyon': require('./lib/rules/no-assign-spyon') | ||
'no-assign-spyon': require('./lib/rules/no-assign-spyon'), | ||
'no-unsafe-spy': require('./lib/rules/no-unsafe-spy') | ||
}, | ||
@@ -27,3 +28,4 @@ configs: { | ||
'jasmine/valid-expect': 1, | ||
'jasmine/no-assign-spyon': 0 | ||
'jasmine/no-assign-spyon': 0, | ||
'jasmine/no-unsafe-spy': 1 | ||
} | ||
@@ -30,0 +32,0 @@ } |
@@ -33,7 +33,14 @@ { | ||
"eslint": "^2.7.0", | ||
"ghooks": "^1.3.2", | ||
"mocha": "^2.2.5", | ||
"semantic-release": "^4.0.2", | ||
"standard": "^6.0.5" | ||
"standard": "^7.0.0", | ||
"validate-commit-msg": "^2.8.2" | ||
}, | ||
"version": "1.8.1" | ||
"config": { | ||
"ghooks": { | ||
"commit-msg": "validate-commit-msg" | ||
} | ||
}, | ||
"version": "1.9.0" | ||
} |
@@ -31,4 +31,16 @@ # eslint-plugin-jasmine | ||
ESLint itself provides a [Jasmine environment][env] for Jasmine's global | ||
variables. It's therefore recommended to also enable it in your `.eslintrc`: | ||
```yaml | ||
plugins: | ||
- jasmine | ||
env: | ||
jasmine: true | ||
``` | ||
By default, no rules are enabled. See the next section for more. | ||
[env]: http://eslint.org/docs/user-guide/configuring#specifying-environments | ||
## Configuration | ||
@@ -44,2 +56,4 @@ | ||
- jasmine | ||
env: | ||
jasmine: true | ||
extends: 'plugin:jasmine/recommended' | ||
@@ -66,2 +80,3 @@ ``` | ||
[no-assign-spyon][] | 0 | | ||
[no-unsafe-spy][] | 1 | | ||
@@ -78,2 +93,4 @@ For example, using the recommended configuration, the `no-focused-tests` rule | ||
- jasmine | ||
env: | ||
jasmine: true | ||
rules: | ||
@@ -97,2 +114,3 @@ jasmine/no-focused-tests: 0 | ||
[no-assign-spyon]: docs/rules/no-assign-spyon.md | ||
[no-unsafe-spy]: docs/rules/no-unsafe-spy.md | ||
@@ -99,0 +117,0 @@ [configuring rules]: http://eslint.org/docs/user-guide/configuring#configuring-rules |
'use strict' | ||
var rule = require('../../lib/rules/no-suite-dupes') | ||
var linesToCode = require('../helpers/lines_to_code') | ||
var RuleTester = require('eslint').RuleTester | ||
@@ -8,30 +9,18 @@ | ||
/* | ||
* Generate readble code lines block | ||
* // description | ||
* lines[0] | ||
* lines[1] | ||
* ... | ||
* lines[n] | ||
*/ | ||
function toCode (lines, description) { | ||
return (description ? '// ' + description : '') + '\n' + lines.join('\n') | ||
} | ||
eslintTester.run('no-suite-dupes', rule, { | ||
valid: [ | ||
// default | ||
toCode([ | ||
linesToCode([ | ||
'describe("The first suite name", function() {}); ', | ||
'describe("The second suite name", function() {})' | ||
]), | ||
toCode([ | ||
linesToCode([ | ||
'unrelated("The first spec name", function() {}); ', | ||
'unrelated("The second spec name", function() {})' | ||
], 'unrelated'), | ||
toCode([ | ||
linesToCode([ | ||
// used to cause bug | ||
'justAFunction();' | ||
], 'a regular function'), | ||
toCode([ | ||
linesToCode([ | ||
'describe("Handling" + " string " + "concatenation", function() {}); ', | ||
@@ -41,3 +30,3 @@ 'describe("Handling" + " it good", function() {})' | ||
{ | ||
code: toCode([ | ||
code: linesToCode([ | ||
'describe("Some context", function() {', | ||
@@ -57,3 +46,3 @@ ' // it(...', | ||
], | ||
code: toCode([ | ||
code: linesToCode([ | ||
'describe("The first suite name", function() {}); ', | ||
@@ -69,3 +58,3 @@ 'describe("The second suite name", function() {})' | ||
], | ||
code: toCode([ | ||
code: linesToCode([ | ||
'describe("The first suite name", function() {}); ', | ||
@@ -79,3 +68,3 @@ 'describe("The second suite name", function() {})' | ||
], | ||
code: toCode([ | ||
code: linesToCode([ | ||
'describe("unique", function(){', | ||
@@ -93,3 +82,3 @@ ' // it(...', | ||
], | ||
code: toCode([ | ||
code: linesToCode([ | ||
'describe("context", function(){', | ||
@@ -109,3 +98,3 @@ ' describe("unique", function(){', | ||
], | ||
code: toCode([ | ||
code: linesToCode([ | ||
'describe("same", function(){', | ||
@@ -122,3 +111,3 @@ ' describe("same", function(){', | ||
// default | ||
code: toCode([ | ||
code: linesToCode([ | ||
'describe("Same suite name", function() {});', | ||
@@ -135,3 +124,3 @@ 'describe("Same suite name", function() {})' | ||
{ | ||
code: toCode([ | ||
code: linesToCode([ | ||
'describe("Handling" + " string " + "concatenation", function() {}); ', | ||
@@ -153,3 +142,3 @@ 'describe("Handling string concatenation", function() {})' | ||
], | ||
code: toCode([ | ||
code: linesToCode([ | ||
'describe("Same suite name", function() {}); ', | ||
@@ -169,3 +158,3 @@ 'describe("Same suite name", function() {})' | ||
], | ||
code: toCode([ | ||
code: linesToCode([ | ||
'describe("Parent context", function(){', | ||
@@ -192,3 +181,3 @@ ' describe("Same block", function(){', | ||
], | ||
code: toCode([ | ||
code: linesToCode([ | ||
'describe("Same suite name", function() {}); ', | ||
@@ -208,3 +197,3 @@ 'describe("Same suite name", function() {})' | ||
], | ||
code: toCode([ | ||
code: linesToCode([ | ||
'describe("parent context", function(){', | ||
@@ -230,3 +219,3 @@ ' describe("same", function(){', | ||
], | ||
code: toCode([ | ||
code: linesToCode([ | ||
'describe("parent context", function(){', | ||
@@ -233,0 +222,0 @@ ' describe("same", function(){', |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
48199
45
1234
123
6