eslint-plugin-jest-dom
eslint-plugin-jest-dom copied to clipboard
eslint rules for use with jest-dom
**What**: Move logic for checking if expression type is Identifier to getInnerNodeFrom method **Why**: As reported on issue #203, features like `.toBeDisabled()` are not getting recommend as fixes for code...
``` expect(imageElement.style[computed]).toBe(`inset 0px 0px 0px 400px ${c}`) ``` This errors: ``` A fatal parsing error occurred in autofix. Error: Parsing error: Unexpected token : Autofix output: expect(imageElement).toHaveStyle(: inset 0px 0px...
- "eslint-plugin-jest-dom": "^4.0.1", - `node` version: 14.18.0 - `npm` version: 8.5.2 Relevant code or config ```javascript // Here I know the notification should not be in the document. I tried...
- `eslint-plugin-jest-dom` version: 3.8.1 - `node` version: 16.1.0 - `npm` version: 7.11.1 Relevant code or config ```javascript expect(screen.queryAllByRole('option')).toHaveLength(2); // some action here expect(screen.queryAllByRole('option')).toHaveLength(1); ``` What you did: I want to...
- `eslint-plugin-jest-dom` version: 3.9.2 - `node` version: 14.17.6 - `npm` version: 6.14.15 Relevant code or config ```javascript const button = getByRole('button', { name: 'My Button' }); expect(button.disabled).toBe(true); const input =...
- `eslint-plugin-jest-dom` version: 2.1.0 Relevant code or config ```javascript expect(element).toHaveAttribute("aria-checked", "mixed") ``` What you did: I want to assert that the checked status is "mixed". It generally is only "true"...
**What**: Add rules, that are classified as recommended but are not currently listed in Readme (https://github.com/testing-library/eslint-plugin-jest-dom#usage), to the config example **Why**: Makes it easier to enable and disable rules, when...
**What**: Close #171 **Why**: It's valid to use `.toHaveLength(1)` with `*AllBy*` queries to check for "exactly one match". See conclusion of discussions at https://github.com/testing-library/eslint-plugin-jest-dom/issues/171#issuecomment-895074086 **How**: Implement the truth table as...
Detected 1 ESLint reports and/or crashes. Scanned 14249 repositories. Rules: - `jest-dom/prefer-to-have-style` Click to expand ## Rule: jest-dom/prefer-to-have-style - Message: `Cannot read properties of undefined (reading 'replace') Occurred while linting...
This adds support for ESLint v9's upcoming `eslint.config.js` while retaining backwards compatibility with `.eslintrc` - I've marked this as a breaking change since I had to change around the exports...