0Pricing
Vue Academy · Lesson

Unit Testing with Vue Test Utils

Write component unit tests with Vue Test Utils.

Testing Components

Vue Test Utils lets you render a component in a test, inspect its output, and simulate user interaction. You then assert that the component behaves as expected.

mount

The mount function renders a component fully, including all of its child components. It returns a wrapper object with helpers to query and interact with the rendered output.

import { mount } from "@vue/test-utils"
import Counter from "./Counter.vue"

const wrapper = mount(Counter)

All lessons in this course

  1. Introduction to Testing Frameworks
  2. Unit Testing with Vue Test Utils
  3. End-to-End Testing
← Back to Vue Academy