Search⌘ K
AI Features

The Wrapper Object

Explore how to use the Wrapper Object from vue-test-utils to test Vue.js components in detail. Learn to assert component structure, presence of sub-components, and inline styles using Jest utilities, enhancing your testing beyond snapshots.

So far, we’ve made tests using Jest Snapshots. In most cases, that’s what we’ll use, but sometimes we want to assert something more specific.

Although you can access the Vue instance via cmp.vm, you have a set of utilities at your disposal to make it easier. Let’s see what we can do.

The Wrapper Object

The Wrapper is the main object of vue-test-utils. ...