Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eslint-plugin-testing-library

Package Overview
Dependencies
Maintainers
2
Versions
164
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-testing-library - npm Package Compare versions

Comparing version 1.4.1 to 1.5.0

22

lib/rules/await-async-query.js

@@ -33,3 +33,7 @@ 'use strict';

[`CallExpression > Identifier[name=${ASYNC_QUERIES_REGEXP}]`](node) {
if (!isAwaited(node.parent.parent) && !isPromiseResolved(node)) {
if (
!isAwaited(node.parent.parent) &&
!isPromiseResolved(node) &&
!hasClosestExpectResolvesRejects(node)
) {
testingLibraryQueryUsage.push(node);

@@ -105,1 +109,17 @@ }

}
function hasClosestExpectResolvesRejects(node) {
if (!node.parent) {
return;
}
if (node.type === 'CallExpression' && node.callee.name === 'expect') {
const expectMatcher = node.parent.property;
return (
expectMatcher &&
(expectMatcher.name === 'resolves' || expectMatcher.name === 'rejects')
);
} else {
return hasClosestExpectResolvesRejects(node.parent);
}
}

2

package.json
{
"name": "eslint-plugin-testing-library",
"version": "1.4.1",
"version": "1.5.0",
"description": "ESLint rules for Testing Library",

@@ -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