You work in a loop: write code, get feedback, iterate. The faster you get feedback, the faster you can learn and become a more effective developer. Test-Driven React helps you refine your React workflow to give you the feedback you need as quickly as possible. Write strong tests and run them continuously as you work, split complex code up into manageable pieces, and stay focused on what’s important by automating away mundane, trivial tasks. Adopt these techniques and you’ll be able to avoid productivity traps and start building React components at a stunning pace!
Test-Driven React: Find Problems Early, Fix Them Quickly, Code with Confidence
by Trevor Burnham
Find Problems Early, Fix Them Quickly, Code with Confidence
by Trevor Burnham
Test-Driven React is a great hands-on introduction to the latest technologies in front-end development. Even if you have little experience with React and frontend testing, the detailed examples in this book will guide you every step of the way to creating working and tested code.
- Ludovico Fischer
Author of "React for Real"
This book is an amazing timesaver for those entering the world of modern Java- Script. It’s full of tips for the whole React development ecosystem, including VS Code, Jest, Babel, ESLint, Webpack, Enzyme, and many other tools. I’m sure that most developers, even those already quite experienced, should find it more than worthwhile.
- Stefan Turalski
FX Software Developer, BNP Paribas
Twenty-first century web app development (especially in React) can easily become a morass of npm dependencies, copy-pasted Stack Overflow code, and general kludginess. Fortunately, there is hope, in the shape of test-driven development (TDD): write a failing test; make it pass; refactor; repeat. Trevor Burnham’s Test- Driven React will help lead you back from the brink so you can make web development pleasurable again.
- Richard Murnane
Software Developer, 3P Learning
- Darin Wilson
Principal Software Engineer, Infinite Red
Test-Driven React will be a most trusted companion for anyone eager for professional and battle-tested practices applied to the React ecosystem. If you want to learn how to develop robust, safe and maintainable applications, this is the way to go.
- Peter Perlepes
Lead Front-Line Engineer, Welcome Pickups
- Adam Markon
Software Engineer, HubSpot
In an era when big structures are built with small components, unit tests and TDD are a must for every React developer.
- Tim Givois
Senior Engineer, Wizeline
About this Title
Release: P1.0 (2019-06-04)
React has 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.
Discover a more joyful React development experience. Let your tests lead the way!
What You Need
Contents & Extracts
- What’s in This Book
- What’s Not in This Book
- How to Read the Code Examples
- Online Resources
- Mantra: Code with Joy
- Test-Driven Development with Jest
- Introducing Jest excerpt
- The Tao of Test-Driven Development
- Mantra: Red, Green, Repeat
- Example Fizz Buzz Solution
- Integrated Tooling with VS Code
- Editing with VS Code
- Checking Code Quality with ESLint
- Beautifying Code with Prettier
- Real-Time Testing with Wallaby
- Mantra: Live in the Code
- Example Palindrome Finder Solution
- Testing React with Enzyme excerpt
- Starting a React Project
- Testing Simple Components with Enzyme
- Adding a Jest Setup File
- Testing Nested Markup
- Testing Stateful Components
- Mantra: Test One Piece at a Time
- Packaging an App with webpack
- Getting Started with Styled-Components
- Testing Styled Components
- Mantra: Actively Seek Feedback
- Refactoring with Higher-Order Components
- Making Higher-Order Components
- The Controllable Pattern
- Stacking Higher-Order Components
- Inspecting Components with React Devtools
- Mantra: Keep the Unit Small
- Continuous Integration and Collaboration
- Setting Up Travis CI
- Git Hooks with Husky
- Adding Docs with Storybook
- Mantra: Actively Automate