react-testing-library
react-testing-library copied to clipboard
π Simple and complete React DOM testing utilities that encourage good testing practices.
**What**: **Why**: **How**: **Checklist**: - [ ] Documentation added to the [docs site](https://github.com/testing-library/testing-library-docs) - [x] Tests - [x] TypeScript definitions updated - [ ] Ready to be merged closes 1297
After updating from v15 to v16 of testing-library/react, I'm now getting this error in all of my tests - except the tests still pass just fine. `Warning: The current testing...
### My project is react introduced through external linksγ ### Can I use it without installing react or react-dom? If possible, how do I need to configure it? Thank you...
Just opening this for tracking with the associated PR: #1330 . When: ```js render(, { container: document }); ``` (Untested: This bug _may_ require that `Component` render a `` element.)...
**What**: When `container` is set to `document`, the cleanup step fails: ``` TypeError: Cannot read properties of null (reading 'removeChild') ``` This is because the code assumes `document.body` exists: ```...
### Describe the feature you'd like: Testing hooks should support hooks with multiple parameters. Currently, the option "initialProps" of `renderHook`, and the "rerender" function it returns are supporting only a...
- `@testing-library/react` version: "@testing-library/jest-dom": "^5.17.0", "@testing-library/react": "^14.0.0", "@testing-library/user-event": "^14.0.0", - Testing Framework and version: Jest, maybe 29.5.12? Unknown version within Create React App (package-lock says "@types/jest": "^29.5.12",) - DOM Environment:...
**What**: **Why**: More Information: https://github.com/kentcdodds/kcd-scripts/pull/244 **How**: Change module field extension to `.mjs` and upgrade `kcd-scripts` after [pr](https://github.com/kentcdodds/kcd-scripts/pull/244) released. ### screenshots #### after this pr build output is below. #### before...
- `@testing-library/react` version: `15.0.7` - Testing Framework and version: `Bun test v1.1.21` - DOM Environment: `@happy-dom/[email protected]` ### Relevant code or config: `test.setup.ts` ```ts import { GlobalRegistrator } from '@happy-dom/global-registrator'; import...
I have a hook that does some complicated things with state[^1]. Specifically, it works like this: ``` const [pizza, setPizza] = usePizza() console.log(pizza) // { my: { slice: "slice22" },...