React Testing Library · Concept
screen
Testing Library queries find elements in the DOM. Choose getBy, queryBy, or findBy, plus their All variants, based on match count and whether the result appears asynchronously.
Last updated
Syntax
screen.getByRole(role, options)
screen.queryByText(text, options)
await screen.findByText(text, queryOptions, waitForOptions)In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
getByRolegetByLabelTextfindByRolequeryByTextgetAllByTextwithinwaitForuser-event