eslint-plugin-jasmine
Advanced tools
Comparing version 2.10.1 to 3.0.0
@@ -47,3 +47,4 @@ 'use strict' | ||
'jasmine/prefer-jasmine-matcher': 1, | ||
'jasmine/prefer-toHaveBeenCalledWith': 1 | ||
'jasmine/prefer-toHaveBeenCalledWith': 1, | ||
'jasmine/prefer-toBeUndefined': 0 | ||
} | ||
@@ -50,0 +51,0 @@ } |
@@ -11,3 +11,3 @@ 'use strict' | ||
module.exports = function (context) { | ||
var allowed = context.options.length ? context.options : ['expect()'] | ||
var allowed = context.options.length ? context.options : ['expect()', 'expectAsync()'] | ||
@@ -14,0 +14,0 @@ var unchecked = [] |
@@ -11,3 +11,3 @@ 'use strict' | ||
module.exports = function (context) { | ||
var allowed = context.options.length ? context.options : ['expect()'] | ||
var allowed = context.options.length ? context.options : ['expect()', 'expectAsync()'] | ||
var setupRegexp = /^(before|after)(Each|All)$/ | ||
@@ -14,0 +14,0 @@ |
{ | ||
"name": "eslint-plugin-jasmine", | ||
"version": "3.0.0", | ||
"description": "ESLint rules for Jasmine", | ||
@@ -13,3 +14,3 @@ "main": "index.js", | ||
"watch": "mocha --watch", | ||
"semantic-release": "semantic-release pre && npm publish && semantic-release post" | ||
"semantic-release": "semantic-release" | ||
}, | ||
@@ -42,5 +43,5 @@ "keywords": [ | ||
"mocha": "^3.1.2", | ||
"semantic-release": "^6.3.2", | ||
"standard": "^10.0.0", | ||
"validate-commit-msg": "^2.8.2" | ||
"validate-commit-msg": "^2.8.2", | ||
"semantic-release": "^15.13.30" | ||
}, | ||
@@ -54,5 +55,4 @@ "config": { | ||
"npm": ">=2", | ||
"node": ">=4" | ||
}, | ||
"version": "2.10.1" | ||
} | ||
"node": ">=8" | ||
} | ||
} |
@@ -67,24 +67,25 @@ # eslint-plugin-jasmine | ||
Rule | Recommended | Options | ||
---- | ----------- | ------- | ||
[expect-matcher][] | 1, | | ||
[expect-single-argument][] | 1, | | ||
[missing-expect][] | 0, `'expect()'` | 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()'` | expectation function names | ||
[no-focused-tests][] | 2 | | ||
[no-global-setup][] | 2 | | ||
[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-toHaveBeenCalledWith][] | 1 | | ||
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-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-toHaveBeenCalledWith][] | 1 | | ||
[prefer-toBeUndefined][] | 0 | `['always', 'never']` | ||
@@ -133,2 +134,3 @@ | ||
[prefer-toHaveBeenCalledWith]: docs/rules/prefer-toHaveBeenCalledWith.md | ||
[prefer-toBeUndefined]: docs/rules/prefer-toBeUndefined.md | ||
@@ -135,0 +137,0 @@ [configuring rules]: http://eslint.org/docs/user-guide/configuring#configuring-rules |
@@ -13,2 +13,3 @@ 'use strict' | ||
'it("", function() {return expect();})', | ||
'it("", function() {return expectAsync(Promise.resolve(true)).toBeResolvedTo(true);})', | ||
'it("", function() {if (foo) {expect();}})', | ||
@@ -18,2 +19,3 @@ 'it("", function() {if (foo) {} else {expect();}})', | ||
'it("", function() {async(function() {expect()})})', | ||
'it("", function() {async(function() {await(expectAsync())})})', | ||
'it("", function() {var foo = expect()})', | ||
@@ -20,0 +22,0 @@ 'it("")', |
@@ -15,2 +15,3 @@ 'use strict' | ||
'it("", function() { expect(true).toBe(true); })', | ||
'it("", function() { return expectAsync(Promise.resolve(true)).toBe(true); })', | ||
'beforeEach(function() { someOtherFunction(); });', | ||
@@ -21,2 +22,3 @@ 'afterEach(function() { someOtherFunction(); });', | ||
'expect(true).toBe(true);', | ||
'expectAsync(Promise.resolve(true)).toBeResolvedTo(true);', | ||
{ | ||
@@ -58,2 +60,10 @@ code: 'it("", function() {$httpBackend.expectGET();})', | ||
{ | ||
code: 'beforeEach(function() { return expectAsync(Promise.resolve(true)).toBeResolvedTo(true); });', | ||
errors: [ | ||
{ | ||
message: 'Unexpected "expectAsync()" call in "beforeEach()"' | ||
} | ||
] | ||
}, | ||
{ | ||
code: 'afterEach(function() { expect(true).toBe(true); });', | ||
@@ -67,2 +77,10 @@ errors: [ | ||
{ | ||
code: 'afterEach(function() { return expectAsync(Promise.resolve(true)).toBeResolvedTo(true); });', | ||
errors: [ | ||
{ | ||
message: 'Unexpected "expectAsync()" call in "afterEach()"' | ||
} | ||
] | ||
}, | ||
{ | ||
code: 'beforeAll(function() { expect(true).toBe(true); });', | ||
@@ -76,2 +94,10 @@ errors: [ | ||
{ | ||
code: 'beforeAll(function() { return expectAsync(Promise.resolve(true)).toBeResolvedTo(true); });', | ||
errors: [ | ||
{ | ||
message: 'Unexpected "expectAsync()" call in "beforeAll()"' | ||
} | ||
] | ||
}, | ||
{ | ||
code: 'afterAll(function() { expect(true).toBe(true); });', | ||
@@ -85,2 +111,10 @@ errors: [ | ||
{ | ||
code: 'afterAll(function() { return expectAsync(Promise.resolve(true)).toBeResolvedTo(true); });', | ||
errors: [ | ||
{ | ||
message: 'Unexpected "expectAsync()" call in "afterAll()"' | ||
} | ||
] | ||
}, | ||
{ | ||
code: 'beforeEach(function() {$httpBackend.expectGET();})', | ||
@@ -87,0 +121,0 @@ options: [ |
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
76
2889
146
107658