Socket
Socket
Sign inDemoInstall

eslint-plugin-jest

Package Overview
Dependencies
Maintainers
11
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 25.0.2 to 25.0.3

7

CHANGELOG.md

@@ -0,1 +1,8 @@

## [25.0.3](https://github.com/jest-community/eslint-plugin-jest/compare/v25.0.2...v25.0.3) (2021-10-11)
### Bug Fixes
* **valid-expect-in-promise:** support awaited promises in arguments ([#936](https://github.com/jest-community/eslint-plugin-jest/issues/936)) ([bd2c33c](https://github.com/jest-community/eslint-plugin-jest/commit/bd2c33c858573d5414d8bc0d401eb6f27801ad2b))
## [25.0.2](https://github.com/jest-community/eslint-plugin-jest/compare/v25.0.1...v25.0.2) (2021-10-11)

@@ -2,0 +9,0 @@

@@ -108,2 +108,31 @@ "use strict";

* Attempts to determine if the runtime value represented by the given `identifier`
* is `await`ed as an argument along the given call expression
*/
const isValueAwaitedInArguments = (name, call) => {
let node = call;
while (node) {
if (node.type === _experimentalUtils.AST_NODE_TYPES.CallExpression) {
for (const argument of node.arguments) {
if (argument.type === _experimentalUtils.AST_NODE_TYPES.AwaitExpression && (0, _utils.isIdentifier)(argument.argument, name)) {
return true;
}
}
node = node.callee;
}
if (node.type !== _experimentalUtils.AST_NODE_TYPES.MemberExpression) {
break;
}
node = node.object;
}
return false;
};
/**
* Attempts to determine if the runtime value represented by the given `identifier`
* is `await`ed or `return`ed within the given `body` of statements

@@ -130,2 +159,7 @@ */

if (node.type === _experimentalUtils.AST_NODE_TYPES.ExpressionStatement) {
// it's possible that we're awaiting the value as an argument
if (node.expression.type === _experimentalUtils.AST_NODE_TYPES.CallExpression && isValueAwaitedInArguments(name, node.expression)) {
return true;
}
if (node.expression.type === _experimentalUtils.AST_NODE_TYPES.AwaitExpression && isPromiseMethodThatUsesValue(node.expression, identifier)) {

@@ -132,0 +166,0 @@ return true;

2

package.json
{
"name": "eslint-plugin-jest",
"version": "25.0.2",
"version": "25.0.3",
"description": "Eslint rules for Jest",

@@ -5,0 +5,0 @@ "keywords": [

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