eslint-plugin-jest-dom icon indicating copy to clipboard operation
eslint-plugin-jest-dom copied to clipboard

fix(prefer-in-document): false positive on .toHaveLength(1) matcher with *AllBy* query

Open SevenOutman opened this issue 2 years ago • 0 comments

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

SevenOutman avatar Oct 09 '22 06:10 SevenOutman