Skip to content
masterclass Buddy

React Testing Library · Function

getByText

React Testing Library’s render mounts a React element and returns queries and helpers for testing it. It uses a document body container by default.

Last updated

Syntax

render(ui, options?)

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • screen
  • rerender
  • unmount
  • asFragment
  • cleanup
  • act
  • renderHook
  • configure

Source: API | Testing Library. Checked 2026-11-03.