Socket
Socket
Sign inDemoInstall

eslint-plugin-jest

Package Overview
Dependencies
Maintainers
9
Versions
325
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-jest - npm Package Compare versions

Comparing version 21.6.1 to 21.6.2

2

docs/rules/valid-expect.md

@@ -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');
```

8

package.json
{
"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 @@ });

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc