Chapter 5: Refactoring Legacy Applications with React Testing Library
In the previous chapter, we learned how to test components in isolation separate from dependencies. We learned how the benefits of testing components can be integrated with other components. We also learned how to test components that use popular third-party User Interface (UI) and state management tools. By the end of this chapter, you will learn strategies for dealing with breaking changes while refactoring legacy React applications. You will learn how to update production packages while using React Testing Library tests to guide you in resolving breaking changes. You will also learn how to convert tests written in Enzyme or ReactTestUtils to React Testing Library.
In this chapter, we're going to cover the following main topics:
- Using tests to catch regressions when updating dependencies
- Refactoring tests written with Enzyme
- Refactoring tests written with ReactTestUtils
- Refactoring tests...