Chapter 10. About Testing and Debugging

React, thanks to components, makes it easy to test our applications. There are many different tools that we can use to create tests with React and we'll cover the most popular ones to understand the benefits they provide.

Jest is an all-in-one testing framework solution, maintained by Christopher Pojer from Facebook and contributors within the community, and aims to give you the best developer experience; but you can decide to create a custom setup with Mocha as well. We will look at both ways of building the best test environment.

You'll learn the difference between Shallow rendering and full DOM rendering with both TestUtils and Enzyme, how Snapshot Testing works, and how to collect some useful code coverage ...

Get React Design Patterns and Best Practices now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.