Skip to content

Commit 56e7f4b

Browse files
nonsocodekazupon
authored andcommitted
Fixed syntax mistake (shallowMount => mount) (#1336)
`shallowMount` doesn't render children components so the example would not have worked. I changed it to `mount`
1 parent 40ba658 commit 56e7f4b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/guides/common-tips.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,13 @@ You can emit a custom event from a child component by accessing the instance.
9595
**Test**
9696

9797
```js
98-
import { shallowMount } from '@vue/test-utils'
98+
import { mount } from '@vue/test-utils'
9999
import ParentComponent from '@/components/ParentComponent'
100100
import ChildComponent from '@/components/ChildComponent'
101101

102102
describe('ParentComponent', () => {
103103
it("displays 'Emitted!' when custom event is emitted", () => {
104-
const wrapper = shallowMount(ParentComponent)
104+
const wrapper = mount(ParentComponent)
105105
wrapper.find(ChildComponent).vm.$emit('custom')
106106
expect(wrapper.html()).toContain('Emitted!')
107107
})

0 commit comments

Comments
 (0)