In this one-hour video tutorial, I'm going to show you how to apply Test-Driven Development to implement a feature for an online ordering application. We'll learn how to identify code smells in it and how to apply small refactorings each time and make the code always in a clean and easy-to-understand state.
React Anti-Patterns: https://www.amazon.com/React-Anti-Pat...
React Clean Code Book: https://leanpub.com/react-clean-code
Maintainable React Book: https://leanpub.com/maintainable-react
Mastering Maintainable React Course: https://www.udemy.com/course/masterin...
Table of Contents:
01:23 - Start coding here
05:26 - First test for the Payment section
08:48 - Move function to separate file
15:26 - Test component in the browser
22:03 - Make the checkbox work
32:16 - Show the correct tip
38:35 - Refactoring
47:53 - Refactoring custom hook
52:50 - Ending
Play it around here: https://codesandbox.io/s/round-up-ref...
Subscribe to my newsletter for more articles and videos on refactoring and clean code tips: https://juntao.substack.com/
Additional Resources:
React Anti-Patterns: https://www.amazon.com/React-Anti-Pat...
React Clean Code Book: https://leanpub.com/react-clean-code
Maintainable React Book: https://leanpub.com/maintainable-react
Mastering Maintainable React Course: https://www.udemy.com/course/masterin...