Learn Vue JS course Learn Javascript and Vue JS Learn VueJS course Learn VueJS Tutorial

Master Vue.js with Vue School Premium

$25 / month

Test with Jest

Get access to this course, 17 others, and future Vue.js courses!

Start Learning

Already got an account? Log in

Jest Expectations

In this lesson, we're diving a little further into the Jest expectations that we can use to test different data types.

We'll learn why we have to use toEqual() instead of toBe() when testing arrays and objects. We will also learn about a handy technique that uses property matchers.

We can use property matchers when we need to test properties that produce random values, where we do not care about the exact value, like a date.