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

eslint-plugin-jest-dom

Package Overview
Dependencies
Maintainers
1
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-jest-dom - npm Package Compare versions

Comparing version 3.8.0 to 3.8.1

9

dist/createBannedAttributeRule.js

@@ -17,3 +17,3 @@ "use strict";

const isBannedArg = node => attributes.some(attr => attr === node.arguments[0].value); //expect(el).not.toBeEnabled() => expect(el).toBeDisabled()
const isBannedArg = node => node.arguments.length && attributes.some(attr => attr === node.arguments[0].value); //expect(el).not.toBeEnabled() => expect(el).toBeDisabled()

@@ -38,2 +38,6 @@

"CallExpression[callee.property.name=/toBe(Truthy|Falsy)?|toEqual/][callee.object.callee.name='expect']"(node) {
if (!node.callee.object.arguments.length) {
return;
}
const {

@@ -69,4 +73,2 @@ arguments: [{

"CallExpression[callee.property.name=/toHaveProperty|toHaveAttribute/][callee.object.property.name='not'][callee.object.object.callee.name='expect']"(node) {
const arg = node.arguments[0].value;
if (!isBannedArg(node)) {

@@ -76,2 +78,3 @@ return;

const arg = node.arguments[0].value;
const correctFunction = getCorrectFunctionFor(node, true);

@@ -78,0 +81,0 @@ const incorrectFunction = node.callee.property.name;

@@ -76,3 +76,3 @@ "use strict";

if (matcherNode.name === "toHaveLength") {
if (matcherNode.name === "toHaveLength" && matcherArguments.length) {
const lengthValue = getLengthValue(matcherArguments); // isNotToHaveLengthZero represents .not.toHaveLength(0) which is a valid use of toHaveLength

@@ -90,3 +90,3 @@

if (matcherNode.name === "toBe" || matcherNode.name === "toEqual") {
if (!usesToBeOrToEqualWithNull(matcherNode, matcherArguments)) {
if (!matcherArguments.length || !usesToBeOrToEqualWithNull(matcherNode, matcherArguments)) {
return;

@@ -135,2 +135,6 @@ }

[`CallExpression[callee.object.object.callee.name='expect'][callee.object.property.name='not'][callee.property.name=${alternativeMatchers}], CallExpression[callee.object.callee.name='expect'][callee.object.property.name='not'][callee.object.arguments.0.argument.callee.name=${alternativeMatchers}]`](node) {
if (!node.callee.object.object.arguments.length) {
return;
}
const arg = node.callee.object.object.arguments[0];

@@ -137,0 +141,0 @@ const queryNode = arg.type === "AwaitExpression" ? arg.argument.callee : arg.callee;

{
"name": "eslint-plugin-jest-dom",
"version": "3.8.0",
"version": "3.8.1",
"description": "ESLint plugin to follow best practices and anticipate common mistakes when writing tests with jest-dom",

@@ -49,3 +49,3 @@ "main": "dist/index.js",

"@typescript-eslint/parser": "^4.8.2",
"eslint": "7.23",
"eslint": "7.24",
"eslint-remote-tester": "^0.3.3",

@@ -52,0 +52,0 @@ "jest-extended": "^0.11.5",

@@ -17,3 +17,3 @@ <div align="center">

<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-14-orange.svg?style=flat-square)](#contributors-)
[![All Contributors](https://img.shields.io/badge/all_contributors-15-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->

@@ -165,2 +165,5 @@ [![PRs Welcome][prs-badge]][prs]

</tr>
<tr>
<td align="center"><a href="https://github.com/G-Rath"><img src="https://avatars.githubusercontent.com/u/3151613?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Gareth Jones</b></sub></a><br /><a href="https://github.com/testing-library/eslint-plugin-jest-dom/commits?author=G-Rath" title="Tests">⚠️</a> <a href="https://github.com/testing-library/eslint-plugin-jest-dom/commits?author=G-Rath" title="Code">πŸ’»</a> <a href="https://github.com/testing-library/eslint-plugin-jest-dom/issues?q=author%3AG-Rath" title="Bug reports">πŸ›</a></td>
</tr>
</table>

@@ -167,0 +170,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