Testing React Components with RTL
By now you've built and styled a real React application. This week you'll learn how to make sure it actually works; not just "I refreshed the browser and it looked fine", but verifiably, repeatably, and automatically.
Testing is one of those topics that developers often skip early in their career and then wish they hadn't. Once you've experienced the confidence of refactoring a utility function while a test suite tells you instantly whether you broke something, you won't want to go back. This week you'll build that habit from the ground up.
You'll learn to think in two distinct layers: unit tests for pure functions where you test inputs and outputs thoroughly, and behavioural tests for React components where you test what a user sees and does rather than how the code is wired. You'll apply both to your portfolio project, which by this point has real components and real logic worth protecting.
The week also covers accessibility testing; making sure your components aren't just functional but actually usable by everyone; plus an introduction to test-driven development, code review practices, and how production error tracking with tools like Sentry fits into the bigger picture of software quality.
getByRole, getByLabelText) and run automated a11y checks with axeThe HackYourFuture curriculum is licensed under CC BY-NC-SA 4.0 *https://hackyourfuture.net/*

Built with ❤️ by the HackYourFuture community · Thank you, contributors
Found a mistake or have a suggestion? Let us know in the feedback form.