Skip to content

Commit a81af2c

Browse files
committed
docs: remove importance of shallow mount
1 parent aaee1ca commit a81af2c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

docs/guides/common-tips.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ const wrapper = shallowMount(Component)
2727

2828
Like [mount](../api/#mount), it creates a [Wrapper](../api/wrapper) that contains the mounted and rendered Vue component, but with stubbed child components.
2929

30+
Notice that using `shallowMount` will make the component under testing different from the component you run in your application – some of its parts won't be rendered! This is why it is not the suggested way of testing components unless you face performance issues or need to simplify test arrangements.
31+
3032
### Lifecycle Hooks
3133

3234
<div class="vueschool" style="margin-top:1em;"><a href="https://vueschool.io/lessons/learn-how-to-test-vuejs-lifecycle-methods?friend=vuejs" target="_blank" rel="sponsored noopener" title="Learn how to use Vue Test Utils to test Vue.js Lifecycle Hooks with Vue School">Learn how to test lifecycle methods and intervals with Vue School</a></div>

0 commit comments

Comments
 (0)