React Testing Library · Module
getAllByText
Use getByText to find one element whose text matches a string or pattern. React Testing Library exposes the same query through screen or the object returned by render.
Last updated
Syntax
getByText(container: HTMLElement, text: TextMatch, options?: { selector?: string; exact?: boolean; ignore?: string | boolean; normalizer?: NormalizerFn }): HTMLElementIn-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
queryByTextgetAllByTextqueryAllByTextfindByTextfindAllByTextscreenwithinrender