Custom Matchers for Jest

Learn what a matcher is, why we need them, and how to develop your own.

What is a matcher?

A matcher (or an assertion) is a function that is used to check for a specific condition. Most often, it compares two values. Here are some of the basic matches available in Jest:

Get hands-on with 1200+ tech skills courses.