eslint-plugin-jest-dom
eslint-plugin-jest-dom copied to clipboard
fix(prefer-in-document): false positive on .toHaveLength(1) matcher with *AllBy* query
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 described in the link above.
Checklist:
- [x] Documentation
- [x] Tests
- [x] Ready to be merged