Open
Description
Documentation Feedback
it doesn't work for me by using the example unit test code in the documentation, but it works below:
import { mount } from '@vue/test-utils'
import Vue from 'Vue'
describe('ParentComponent', () => {
const wrapper = mount(ParentComponent)
it("displays 'Emitted!' when custom event is emitted", async () => {
const child = wrapper.findComponent(ChildComponent)
child.vm.$emit('custom')
await Vue.nextTick()
expect(wrapper.html()).toContain('Emitted!')
})
})
Affected documentation page: Insert a link to the affected page
https://vue-test-utils.vuejs.org/zh/guides/#%E5%B8%B8%E7%94%A8%E6%8A%80%E5%B7%A7