...

/

When a Test Fails

When a Test Fails

In this lesson, we'll learn about what to do when a test fails in Snapshot Testing.

The snapshots generated are the source of truth for deciding if a test is valid or not. That’s the way regressions are checked, and in the end, it depends on your criteria.

Example

For example, go to the ContactBox.vue component and change the fullName computed prop to be separated by a comma:

fullName() {
return `${this.name}, ${this.surname}`;
}

If you run the tests again, some of them will fail since the rendering result is different ...

Access this course and 1400+ top-rated courses and projects.