Chapter 12. Writing snapshot tests

This chapter covers

  • Understanding snapshot tests
  • Adding snapshot tests to your workflow
  • Writing snapshot tests for components

In this chapter, you’ll learn what snapshot tests are, how they fit in to the testing workflow, and how to use them to make sure components aren’t changed unintentionally.

Definition

Snapshot testing is a way of comparing two pictures of an application automatically.

Up until this chapter, you’ve learned to write unit tests. Now it’s time to add a new type of test to your testing tool belt. If you remember from back in chapter 1, I showed you how to use the frontend pyramid as a guide for how to structure a test suite (figure 12.1). The next type of tests in the ...

Get Testing Vue.js Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.