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
- Introduction to Testing Frameworks
- Unit Testing with Vue Test Utils
- End-to-End Testing