react-testing-library
react-testing-library copied to clipboard
🐐 Simple and complete React DOM testing utilities that encourage good testing practices.
### Our Various Versions of Things - Testing Framework and version: "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^14.0.0", "@testing-library/user-event": "^14.4.3", "vitest": "^1.5.3" - DOM Environment: "jsdom": "^21.1.0", - React & Node Versions: "@types/node":...
**What**: Alternate to https://github.com/testing-library/react-testing-library/pull/1333 Adds support for `onRecoverableError` and `onCaughtError` (React 19 only) `onUncaughtError` is not supported yet because there's no use. The `render` would throw anyway. We're likely going...
This has no effect right now since `latest` and `18.x` point at the same version. Once React 19 is out, we'll be running tests in both 18 and 19. The...
**What**: adding a new `advanceTimers` configuration option to resolve #1197 Possibly also #1393 and #1187, but maintainers are smarter than me about this, whether it also covers those. **Why**: as...
- `@testing-library/react` version: 16.1.0 - Testing Framework and version: jest 29.7.0 - DOM Environment: jsdom 29.7.0 ### Relevant code or config: ```js render( ); expect(screen.getByText("fallback")).toBeInTheDocument(); expect(await screen.findByText("resolved")).toBeInTheDocument(); ``` ### What...
**What**: To fix incorrect `onCaughtError` type inference in `RenderOptions`. Repro: https://codesandbox.io/p/devbox/delicate-voice-7wnf7z?file=%2Ftest%2Frender.test-d.ts%3A6%2C5-6%2C28 **Why**: _As explained above._ **How**: Update TS types. **Checklist**: - [ ] Documentation added to the [docs site](https://github.com/testing-library/testing-library-docs) -...
- `@testing-library/react` version: 16.3.0 - Testing Framework and version: `node:test`, 22.14.0 - DOM Environment: jsdom 26.0.0 ### Relevant code or config: ```jsx import { screen } from '@testing-library/react'; import {...
- `@testing-library/react` version: 16.2.0 - Testing Framework and version: vitest - DOM Environment: chromium, via `@vitest/browser` ### Relevant code or config: ```tsx import { use } from 'react'; import {...
**What**: Add render hook support for multiple arguments **Why**: renderHook only supports a single argument via initialProps, making it hard to test hooks with multiple parameters. This PR introduces initialArgs...
Added commands for pnpm. **What**: Only added the relevant commands for pnpm **Why**: To allow pnpm users to get started quickly **Checklist**: - [ ] Documentation added to the [docs...