Common mistakes with React Testing Library
The creator of React Testing Library explains common mistakes developers make and provides advice on how to write better tests.
Software engineer and educator
166 Articles from this blog
The creator of React Testing Library explains common mistakes developers make and provides advice on how to write better tests.
A guide to using different function forms in JavaScript and React, including personal rules for function declarations, expressions, and arrow functions.
Explains why client-side redirects are bad for performance and recommends using server-side redirects instead.
A guide on testing custom React hooks, using a useUndo hook as a practical example to demonstrate effective testing strategies.
A guide on using React's Profiler API to monitor and track component render performance in production applications.
Explains why and how to replace the axios HTTP library with a lightweight, custom wrapper around the browser's native fetch API.
The article argues for automating repetitive workflows, highlighting benefits beyond just time-saving, like maintaining focus and reducing mental friction.
A personal reflection on the author's life journey through the 2010s, covering career, family, and personal growth.
Article argues that code quality directly impacts user experience by enabling faster feature delivery and fewer bugs.
An open source developer draws parallels between community building in software and neighborhood revitalization, emphasizing kindness and proactive effort.
Explains how to write resilient UI tests using user-centric queries instead of brittle CSS selectors, with examples in React.
A guide on how to start adding tests to a large, existing codebase, focusing on the Testing Trophy methodology for the best return on investment.
A guide to React performance optimization, explaining the difference between the render and commit phases and why focusing on slow renders is key.
A guide on using the React DevTools Profiler to measure app performance, including a warning to profile in production mode for accurate results.
A guide to common mistakes when using React Hooks and practical advice on how to avoid them for better code.
A software engineer explains that experience comes from solving diverse problems, not just time, and suggests ways to find them.
The article argues against writing many small, single-assertion tests for React components, advocating for fewer, more comprehensive tests.
A guide on effective software testing: write tests, avoid 100% coverage, and focus on integration tests for confidence.
A guide on when to split a large React component into smaller ones, focusing on solving real problems rather than premature abstraction.
Explains why nesting in tests, especially with beforeEach hooks, leads to unmaintainable code, using a React component as an example.