Skip to content

Commit d904f26

Browse files
authored
docs(mounting options): add a tip how to mock $root. Fix vuejs#1437 (vuejs#1438)
* docs(mounting options): add a tip how to mock $root Clarify how to mock $root fix vuejs#1437 * docs(mounting-options): remove blank line
1 parent b41a09d commit d904f26

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

docs/api/options.md

+4
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,10 @@ const wrapper = shallowMount(Component, {
251251
expect(wrapper.vm.$route.path).toBe($route.path)
252252
```
253253

254+
::: tip
255+
To mock `$root` please use `parentComponent` option instead as described [here](https://github.com/vuejs/vue-test-utils/issues/481#issuecomment-423716430)
256+
:::
257+
254258
## localVue
255259

256260
- type: `Vue`

docs/ru/api/options.md

+4
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,10 @@ const wrapper = shallowMount(Component, {
172172
expect(wrapper.vm.$route.path).toBe($route.path)
173173
```
174174

175+
::: tip
176+
Для создания мока `$root` нужно использовать опцию `parentComponent` как описано [здесь](https://github.com/vuejs/vue-test-utils/issues/481#issuecomment-423716430)
177+
:::
178+
175179
## localVue
176180

177181
- Тип: `Vue`

0 commit comments

Comments
 (0)