-- React Testing Library _top_ Now Maths | 3eme Tech
react testing library
1ère année

React Testing Library _top_ Now

A standard test follows this pattern: .

test('useCounter hook increments', () => { const { result } = renderHook(() => useCounter(0)) react testing library

test('types into input', async () => { render(<MyForm />); A standard test follows this pattern:

test('it renders a button and handles a click', () => { // 1. Render the component render(<Button />); useCounter(0)) test('types into input'

import { waitFor, screen } from '@testing-library/react'

React Testing Library has several advantages over other testing libraries, including: