Chapter 4Test Your React Components

Manually navigating through a large application to check that everything works is too time consuming. It’s better to test parts of the application with automated tests.

When the UI makes a substantial part of the application, it’s difficult to create automated tests that not only inform you of errors but also require reasonably little code.

One option would be to use a browser automation library to navigate through your application, but this sort of test tends to fail in ways that are difficult to interpret. It also takes a long time to set up, so it’s only useful for testing at a high level. It also doesn’t require any React-specific knowledge, so I encourage you to refer to other books or resources to ...

Get React for Real 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.