Vue Test Utils — testing utilities.
1import { mount, shallowMount } from "@vue/test-utils"2import MyComponent from "./MyComponent.vue"34// Mount component5const wrapper = mount(MyComponent, {6 props: { title: "Hello" },7 global: {8 plugins: [pinia],9 stubs: { ChildComponent: true }10 }11})1213// Find elements14const button = wrapper.find("button")15const items = wrapper.findAll("li")1617// Trigger events18await button.trigger("click")19await wrapper.find("input").setValue("new value")2021// Assert22expect(wrapper.text()).toContain("Hello")23expect(wrapper.emitted("update")).toBeTruthy()