Test-Driven React 2 (PragProg)

Learn the right way to do test-driven development with React. You'll come away knowing how to use the latest tools to streamline your entire workflow.


Trevor Burnham @TrevorBurnham

edited by Jacquelyn Carter @jkcarter

You work in a loop: write code, get feedback, adjust. The faster you get feedback, the faster you can learn and become a more effective developer. Turn your React project requirements into tests and get the feedback you need faster than ever before. Stay focused on what’s important by running your tests continuously in the background. The second edition of Test-Driven React has been extensively revised to reflect the latest tools and techniques for React development, including TypeScript. Combine the power of testing, linting, and typechecking directly in your coding environment to iterate on React components quickly and fearlessly!

React revolutionized web development by abstracting away the details of DOM manipulation. That conceptual elegance has opened the door to a new generation of web testing: clear, expressive, and lightning fast. That makes React a perfect fit for test-driven development (TDD), a methodology in which tests are a blueprint instead of an afterthought.

Each chapter presents new projects to challenge you and new tools to help you. Write fast, easy-to-understand tests with Vitest and React Testing Library. Keep your code tidy with ESLint and Prettier. Perform every task you need from a single window within VS Code. See your test output directly in your code with Wallaby. Style components in a test-friendly way with styled-components. By understanding every piece of your project’s stack, you’ll feel more confident and able to focus on what matters: writing reliable and maintainable code.

The second edition of Test-Driven React has been updated to use TypeScript, the language of choice for modern React development. Find and fix type errors without even running your code. Generate beautiful documentation from type annotations with Storybook, and update it on every commit with GitHub Actions.

Discover a more joyful React development experience. Let your tests lead the way!

Trevor Burnham is a front-end engineer at Amazon Web Services (AWS). His previous books include CoffeeScript and Async JavaScript, both published by The Pragmatic Bookshelf.

Don’t forget you can get 35% off with your Devtalk discount! Just use the coupon code “devtalk.com" at checkout :+1:


I’ve been assigned to a React project for the next few months, so I’ll probably be getting this one :slight_smile: