Skip to main content

rtl-simple-queries

rtl-simple-queries is a companion library for React Testing Library that provides an alternative query API.

npm install --save-dev rtl-simple-queries
import {screen} from 'rtl-simple-queries'

screen.fetchByText(/text/, {allowEmpty: true, allowMultiple: false})
screen.fetchByText(/text/, {allowMultiple: false})
screen.fetchByText(/text/)

// async
await screen.fetchByTextAsync(/text/, {allowMultiple: true})