Skip to content

Disallow the use of queryBy* queries for assertions #269

Closed
@thomaslombart

Description

@thomaslombart

I've seen people using queryBy as assertions in their tests:

screen.queryByText("Account")

This is not the right way to use it because the test won't fail whether the text is there or not.

Would it be possible to extend the prefer-explicit-assert rule in order to disallow the use of queryBy as assertions as well?

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions