eslint-plugin-jest
Advanced tools
Comparing version 21.6.1 to 21.6.2
@@ -35,2 +35,3 @@ # Enforce valid `expect()` usage (valid-expect) | ||
expect(true).toBeDefined; | ||
expect(Promise.resolve('hello')).resolves; | ||
``` | ||
@@ -44,2 +45,3 @@ | ||
expect(true).toBeDefined(); | ||
expect(Promise.resolve('hello')).resolves.toEqual('hello'); | ||
``` |
{ | ||
"name": "eslint-plugin-jest", | ||
"version": "21.6.1", | ||
"version": "21.6.2", | ||
"description": "Eslint rules for Jest", | ||
@@ -24,4 +24,4 @@ "repository": "jest-community/eslint-plugin-jest", | ||
"devDependencies": { | ||
"@commitlint/cli": "^5.2.0", | ||
"@commitlint/config-conventional": "^5.1.3", | ||
"@commitlint/cli": "^6.0.1", | ||
"@commitlint/config-conventional": "^6.0.2", | ||
"eslint": "^4.10.0", | ||
@@ -33,3 +33,3 @@ "eslint-config-prettier": "^2.7.0", | ||
"lint-staged": "^6.0.0", | ||
"prettier": "^1.8.1", | ||
"prettier": "^1.10.2", | ||
"semantic-release": "^11.0.2" | ||
@@ -36,0 +36,0 @@ }, |
@@ -104,3 +104,33 @@ 'use strict'; | ||
}, | ||
{ | ||
code: 'expect(true).resolves;', | ||
errors: [ | ||
{ | ||
endColumn: 22, | ||
column: 14, | ||
message: '"resolves" needs to call a matcher.', | ||
}, | ||
], | ||
}, | ||
{ | ||
code: 'expect(true).rejects;', | ||
errors: [ | ||
{ | ||
endColumn: 21, | ||
column: 14, | ||
message: '"rejects" needs to call a matcher.', | ||
}, | ||
], | ||
}, | ||
{ | ||
code: 'expect(true).not;', | ||
errors: [ | ||
{ | ||
endColumn: 17, | ||
column: 14, | ||
message: '"not" needs to call a matcher.', | ||
}, | ||
], | ||
}, | ||
], | ||
}); |
@@ -86,2 +86,9 @@ 'use strict'; | ||
if (grandParent.type === 'ExpressionStatement') { | ||
let message; | ||
if (expectProperties.indexOf(propertyName) > -1) { | ||
message = `"${propertyName}" needs to call a matcher.`; | ||
} else { | ||
message = `"${propertyName}" was not called.`; | ||
} | ||
context.report({ | ||
@@ -91,3 +98,3 @@ // For some reason `endColumn` isn't set in tests if `loc` is not | ||
loc: parentProperty.loc, | ||
message: `"${propertyName}" was not called.`, | ||
message, | ||
node: parentProperty, | ||
@@ -94,0 +101,0 @@ }); |
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
60684
1518