O'Reilly logo

Pro React by Cássio de Sousa Antonio

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 9

image

Testing React Components

As our applications grow more complex and we continue to add new features, we need to verify that our new implementations haven’t introduced bugs to our existing functionalities. Automated testing provides a living documentation of expected behaviors and allows us to develop with more confidence, knowing that any problems will be immediately apparent.

In this chapter, we will introduce Jest (React’s preferred testing framework) and TestUtils, a set of methods that makes it easy to test React components in any common JavaScript testing framework.

Jest

Jest is React’s recommended testing framework. It is based ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required