Unit Testing Vue 2

Lessons

1. What to test

4:58

2. Writing a Unit Test with Jest

9:25

3. Testing Props & User Interaction

7:15

4. Testing Emitted Events

6:56

5. Testing API Calls

9:52

6. Stubbing Child Components

6:01

Testing API Calls

Unless you’re working with a simple static website, your Vue app is likely making API calls from within certain components. In this lesson, we’ll look at how we can test these kinds of data-fetching components.

The first thing to understand about testing components that make API calls is that we don’t want to be making real calls out to our backend. Doing so would couple our unit tests to the backend. This becomes an issue when we want to execute our unit tests in [Continuou