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

Test with Jest

Get access to the most comprehensive Vue.js video library in the world. Over 300 video lessons including the newest Vue 3 features.

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.