Unit Tests with Enzyme
In this lesson, we'll discuss unit testing in React using a testing utility called Enzyme.
We'll cover the following...
We'll cover the following...
Introduction to Enzyme
Enzyme is a testing utility by Airbnb to assert, manipulate, and traverse React components. It is used to conduct unit tests to complement snapshot tests in React. First we have to install it along with its extension, since it doesn’t come with create-react-app.
Installing Enzyme
Second, we include it in the test setup and we initialize its adapter.
Now you can write your first unit test in the Table “describe”-block. You will use ...