Skip to content
masterclass Buddy

React Testing Library · Pipe

asFragment

React Testing Library's render mounts a React element and returns queries and helpers for testing it. The API also includes cleanup, hooks, actions, and configuration utilities.

Last updated

Syntax

function render(ui: React.ReactElement<any>, options?: RenderOptions): RenderResult

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

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

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