Summary
In this chapter, you learned about the DOM Testing Library and how it is designed to help you write user-focused tests. You now understand how the design of the DOM Testing Library can help you gain confidence that your software works as intended for users. You learned how to install Jest and understand that it is a test runner and the tool we will use to test React code. You learned about jest-dom
. You know how it can add better error messages and descriptive DOM matchers for your test assertions. You can now install and use jest-dom
in a project that uses Jest. Finally, you have gained an understanding of the disadvantages of implementation detail-focused testing.
In the next chapter, we will learn how to install and start writing tests for React components using React Testing Library.