Testing your application state and methods

In this recipe, we will write a unit test to touch and check the state of our Vue instance directly. The advantage of testing the state of our components instead of looking for something in our web page is that we don't have to wait for the DOM to be updated and that, even if something changes in the HTML layout, the state changes much more slowly, reducing the amount of maintenance required for our tests.

Get Vue.js 2 Cookbook 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.