Socket
Socket
Sign inDemoInstall

eslint-plugin-jest-dom

Package Overview
Dependencies
113
Maintainers
1
Versions
60
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.2.4 to 3.3.0

dist/queries.js

4

dist/rules/prefer-to-have-style.js

@@ -148,2 +148,6 @@ "use strict";

fix(fixer) {
if (!styleValue) {
return null;
}
return [fixer.removeRange([node.object.range[1], node.property.range[1]]), fixer.replaceText(matcher, "toHaveStyle"), fixer.replaceTextRange([styleName.range[0], styleValue.range[1]], `{${camelCase(styleName.value)}: ${context.getSourceCode().getText(styleValue)}}`)];

@@ -150,0 +154,0 @@ }

8

package.json
{
"name": "eslint-plugin-jest-dom",
"version": "3.2.4",
"version": "3.3.0",
"description": "ESLint plugin to follow best practices and anticipate common mistakes when writing tests with jest-dom",

@@ -42,6 +42,7 @@ "main": "dist/index.js",

"@babel/runtime": "^7.9.6",
"@testing-library/dom": "^7.28.1",
"requireindex": "^1.2.0"
},
"devDependencies": {
"eslint": "6.8",
"eslint": "7.14",
"jest-extended": "^0.11.5",

@@ -57,3 +58,4 @@ "kcd-scripts": "6.5.1"

"babel/quotes": "off",
"max-lines-per-function": "off"
"max-lines-per-function": "off",
"testing-library/no-dom-import": "off"
}

@@ -60,0 +62,0 @@ },

@@ -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-9-orange.svg?style=flat-square)](#contributors-)
[![All Contributors](https://img.shields.io/badge/all_contributors-12-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->

@@ -104,14 +104,13 @@ [![PRs Welcome][prs-badge]][prs]

<!-- __BEGIN AUTOGENERATED TABLE__ -->
| Name | πŸ‘ | πŸ”§ | Description |
| ---------------------------------------------------------------------------------------------------------------------------------------------- | --- | --- | -------------------------------------------------------------- |
| [prefer-checked](https://github.com/testing-library/eslint-plugin-jest-dom/blob/master/docs/rules/prefer-checked.md) | πŸ‘ | πŸ”§ | prefer toBeChecked over checking attributes |
| [prefer-empty](https://github.com/testing-library/eslint-plugin-jest-dom/blob/master/docs/rules/prefer-empty.md) | πŸ‘ | πŸ”§ | Prefer toBeEmpty over checking innerHTML |
| [prefer-enabled-disabled](https://github.com/testing-library/eslint-plugin-jest-dom/blob/master/docs/rules/prefer-enabled-disabled.md) | πŸ‘ | πŸ”§ | prefer toBeDisabled or toBeEnabled over checking attributes |
| [prefer-focus](https://github.com/testing-library/eslint-plugin-jest-dom/blob/master/docs/rules/prefer-focus.md) | πŸ‘ | πŸ”§ | prefer toHaveFocus over checking document.activeElement |
| [prefer-required](https://github.com/testing-library/eslint-plugin-jest-dom/blob/master/docs/rules/prefer-required.md) | πŸ‘ | πŸ”§ | prefer toBeRequired over checking properties |
| [prefer-to-have-attribute](https://github.com/testing-library/eslint-plugin-jest-dom/blob/master/docs/rules/prefer-to-have-attribute.md) | πŸ‘ | πŸ”§ | prefer toHaveAttribute over checking getAttribute/hasAttribute |
| [prefer-to-have-style](https://github.com/testing-library/eslint-plugin-jest-dom/blob/master/docs/rules/prefer-to-have-style.md) | πŸ‘ | πŸ”§ | prefer toHaveStyle over checking element style |
| [prefer-to-have-text-content](https://github.com/testing-library/eslint-plugin-jest-dom/blob/master/docs/rules/prefer-to-have-text-content.md) | πŸ‘ | πŸ”§ | Prefer toHaveTextContent over checking element.textContent |
Name | πŸ‘ | πŸ”§ | Description
----- | ----- | ----- | -----
[prefer-checked](https://github.com/testing-library/eslint-plugin-jest-dom/blob/master/docs/rules/prefer-checked.md) | πŸ‘ | πŸ”§ | prefer toBeChecked over checking attributes
[prefer-empty](https://github.com/testing-library/eslint-plugin-jest-dom/blob/master/docs/rules/prefer-empty.md) | πŸ‘ | πŸ”§ | Prefer toBeEmpty over checking innerHTML
[prefer-enabled-disabled](https://github.com/testing-library/eslint-plugin-jest-dom/blob/master/docs/rules/prefer-enabled-disabled.md) | πŸ‘ | πŸ”§ | prefer toBeDisabled or toBeEnabled over checking attributes
[prefer-focus](https://github.com/testing-library/eslint-plugin-jest-dom/blob/master/docs/rules/prefer-focus.md) | πŸ‘ | πŸ”§ | prefer toHaveFocus over checking document.activeElement
[prefer-in-document](https://github.com/testing-library/eslint-plugin-jest-dom/blob/master/docs/rules/prefer-in-document.md) | | πŸ”§ | Prefer .toBeInTheDocument() in favor of checking the length of the result using .toHaveLength(1)
[prefer-required](https://github.com/testing-library/eslint-plugin-jest-dom/blob/master/docs/rules/prefer-required.md) | πŸ‘ | πŸ”§ | prefer toBeRequired over checking properties
[prefer-to-have-attribute](https://github.com/testing-library/eslint-plugin-jest-dom/blob/master/docs/rules/prefer-to-have-attribute.md) | πŸ‘ | πŸ”§ | prefer toHaveAttribute over checking getAttribute/hasAttribute
[prefer-to-have-style](https://github.com/testing-library/eslint-plugin-jest-dom/blob/master/docs/rules/prefer-to-have-style.md) | πŸ‘ | πŸ”§ | prefer toHaveStyle over checking element style
[prefer-to-have-text-content](https://github.com/testing-library/eslint-plugin-jest-dom/blob/master/docs/rules/prefer-to-have-text-content.md) | πŸ‘ | πŸ”§ | Prefer toHaveTextContent over checking element.textContent
<!-- __END AUTOGENERATED TABLE__ -->

@@ -157,2 +156,5 @@

<td align="center"><a href="https://github.com/atsikov"><img src="https://avatars3.githubusercontent.com/u/1422928?v=4" width="100px;" alt=""/><br /><sub><b>Aleksei Tsikov</b></sub></a><br /><a href="https://github.com/testing-library/eslint-plugin-jest-dom/issues?q=author%3Aatsikov" title="Bug reports">πŸ›</a></td>
<td align="center"><a href="https://mario.dev"><img src="https://avatars1.githubusercontent.com/u/2677072?v=4" width="100px;" alt=""/><br /><sub><b>Mario BeltrΓ‘n AlarcΓ³n</b></sub></a><br /><a href="https://github.com/testing-library/eslint-plugin-jest-dom/commits?author=Belco90" title="Documentation">πŸ“–</a></td>
<td align="center"><a href="https://codepen.io/ariperkkio/"><img src="https://avatars2.githubusercontent.com/u/14806298?v=4" width="100px;" alt=""/><br /><sub><b>Ari PerkkiΓΆ</b></sub></a><br /><a href="https://github.com/testing-library/eslint-plugin-jest-dom/issues?q=author%3AAriPerkkio" title="Bug reports">πŸ›</a></td>
<td align="center"><a href="http://www.antn.se"><img src="https://avatars0.githubusercontent.com/u/785676?v=4" width="100px;" alt=""/><br /><sub><b>Anton Niklasson</b></sub></a><br /><a href="https://github.com/testing-library/eslint-plugin-jest-dom/commits?author=AntonNiklasson" title="Code">πŸ’»</a> <a href="https://github.com/testing-library/eslint-plugin-jest-dom/commits?author=AntonNiklasson" title="Tests">⚠️</a> <a href="https://github.com/testing-library/eslint-plugin-jest-dom/commits?author=AntonNiklasson" title="Documentation">πŸ“–</a></td>
</tr>

@@ -159,0 +161,0 @@ </table>

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚑️ by Socket Inc