Autoplay

    Course Overview: Testing React Components with Enzyme and Jest

    Tyler ClarkTyler Clark

    This course is designed to give you the power to not only create composable elements but to create predictable React components. We will review most of the concepts required to make intuitive tests based on how our users will interact with the components.

    The course begins with basic concepts of setup and installing configurations to work with any release of React. Throughout the course we break down selectors, rendering methods, snapshot testing, and how to replicate user activity. We finish the course with more advanced lessons, the 'putting it all together' tutorials. We test a basic React form and a Redux connected component.

    reactReact
    ^16.0.0
    jestJest
    Code

    Code

    Become a Member to view code

    You must be a Member to view code

    Access all courses and lessons, track your progress, gain confidence and expertise.

    Become a Member
    and unlock code for this lesson
    Transcript

    Transcript

    Instructor: 00:00 When it comes to React, component reusability is king. We want our components to be composable and easy to use for our consumers.

    00:08 This course is designed to teach you all the core concepts of making predictable React components. Throughout this course, we use Enzyme in companion of Jest to test our components, not only how we want them to work but how our users would interact with them.

    00:25 I will show you the ropes of how to use Enzyme, from the initial setup to working with Redux-connected components. You'll learn how to configure Enzyme for whichever version of React you're using.

    00:35 Within this course, we will talk about the accepted selectors, rendering methods, how to work with React lifecycles, component state, and component props.

    00:44 We'll also use the power of Jest's Snapshots to guarantee the layout of component elements. Not to mention, replicating user interaction and testing class methods are two final lessons, combined elements throughout the course, and act as a putting it altogether.

    01:00 We'll test the basic React form that sends an ajax request on submit and test a Redux-connected component. All in an effort to give you the power to create predictable React components.

    Discuss

    Discuss