About the Author xiii
About the Technical Reviewers xv
Acknowledgments xvii
Foreword 1 xix
Foreword 2 xxi
Introduction xxiii
Chapter 1: A Brief History of Test-Driven Development 1
Chapter 2: Get Started with Jest 15
Chapter 3: Refactoring Essentials: The Basics You Need to Know 39
Chapter 4: Test-Driven Development Essentials 65
Chapter 5: Project Setup 81
Chapter 6: Implement the Book List 97
Chapter 7: Implementing the Book Detail View 125
Chapter 8: Searching by Keyword 153
Chapter 9: Introduction to State Management 169
Chapter 10: Book Reviews 197
Chapter 11: Behavior-Driven Development 231
Appendix A: Background of Testing Strategies 245
Appendix B: A Short Introduction to TypeScript 251
Index 259
Apply test-driven principles to create scalable and maintainable React applications. This book covers a wide range of topics, including setting up a testing environment and utilizing popular testing frameworks like Cypress, Jest, and the React Testing Library. It also delves into valuable refactoring techniques, as well as enhancing code maintainability and readability. What sets this comprehensive guide apart is its end-to-end project simulation, showcasing how TDD can be employed to build a complete application called "Bookish."
Test-Driven Development with React and TypeScript elevates its code examples by leveraging TypeScript, the predominant language in modern frontend development, offering you a deeper understanding of how TDD principles can be applied to React projects. Furthermore, all code examples have been carefully revised and updated for this edition, incorporating reader feedback and reflecting current industry standards.
After completing this book, you have the knowledge and skills necessary to develop high quality and scalable React applications.
Master essential refactoring techniques to enhance code quality
Employ modern practices for writing maintainable React code, including testing and product implementation
Gain practical experience applying test-driven development (TDD) principles to real-world projects
Craft high quality, scalable, and maintainable React applications using TDD principles and techniques
Web application developers who wants to learn how to write high quality code using test-driven development.