Skip to content

Replace prefer-expect-query-by by better rule #61

@Belco90

Description

@Belco90

Motivated by #59 it looks like we need to replace prefer-expect-query-by* by better implementation to only force users to replace getBy queries by queryBy when:

This should be checked in several cases. A few I can think of at the moment:

  • asserting with .not.toBeInTheDocument()
  • asserting with .toBeNull()
  • asserting with .toBe(null) this is actually an equivalent for the previous one, probably more variations to cover as .toBeFalsy() but I think just this one is enough for now?
  • waiting for disappearance with waitForElementToBeRemoved

I can't think better name for this rule than no-get-by-for-element-absence, any suggestions?

*We could maintain prefer-expect-query-by when the new rule is implemented, but I think it wouldn't be that useful anymore and could even lead to confusion

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needednew ruleNew rule to be included in the pluginreleased

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions