Learn how matchers allow us to test different conditions.


Jest uses what are known as matchers to match the expected values in a test to the received values.

Let’s have a quick look at some of these matchers.

The toBe matcher

Let’s take a look at the following code to understand the toBe matcher.

Get hands-on with 1200+ tech skills courses.