testing-library/eslint-plugin-testing-library

New rule to prevent to use `expect(query*(...)).toBeDefined()`

retyui opened this issue · 1 comments

Name for new rule

your-name

Description of the new rule

False Positives check, that need to be forbidden:

query*(...) // null | Elemnt
expect(null).toBeDefined(); // true

Testing Library feature

.query*(...)

Testing Library framework(s)

dom 7 react-native

What category of rule is this?

Suggests an alternate way of doing something

Optional: other category of rule

No response

Code examples

query*(...) // null | Elemnt
expect(null).toBeDefined(); // true
expect(query*(...)).toBeDefined(); // bad

Anything else?

No response

Do you want to submit a pull request to make the new rule?

No