Tag: Testing Library
All the articles with the tag "Testing Library".
React Router Vitest Example
Updated: at 12:00 PMReact Router 8.5, Vite 8, and Vitest 5. Skip the React Router plugin when Vitest runs, or the preamble check throws.
How to test React apps with Vitest and Vite
Updated: at 12:00 PMSet up Vitest and React Testing Library on Vite. Put the test block in vite.config.ts and load @testing-library/jest-dom/vitest. The button says Count is 0.
How To Use rerender in React Testing Library
Updated: at 12:00 PMrerender updates props on the component already mounted. A second render() adds a copy, so the label query matches twice.
Your Guide to Testing React Components
Published: at 09:21 AMMaster React component testing with this guide on Enzyme-RTL conversion, prop testing, hooks, DOM structures, and optimization
Understanding Jest Snapshots: A Beginner's Guide to Snapshot Testing
Updated: at 05:14 AMGet started with Jest Snapshots: beginner's guide to snapshot testing, usage, updates, and other React component testing techniques
How to test a className with Jest and React testing library
Updated: at 08:20 PMReact Testing Library has no getByClassName. Query by role or text, assert the class with toHaveClass, and use querySelector only when you need a class name.