Test with Jest
Plans from $25/month

This lesson is for members. Join us?

Subscribe now to get instant access to this course, plus a full library of Vue.js courses tailored to the plan you choose.

Execute Code Before and After Tests

Short tests are often good tests. In order to prevent unnecessarily repetitions, we can use Jest's hooks to run code before or after every test.

In this lesson, you'll learn how to execute code before every test and also see a practical example of why it's beneficial.