New rule to prevent to use `expect(query*(...)).toBeDefined()`
retyui opened this issue · 1 comments
retyui commented
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(); // trueTesting 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(); // badAnything else?
No response
Do you want to submit a pull request to make the new rule?
No
Belco90 commented
Hi @retyui. You can achieve this using the eslint-plugin-jest/no-restricted-matchers rule.