Skip to content

Commit 66eeb15

Browse files
committed
docs(mounting options): add a tip how to mock $root
Clarify how to mock $root fix vuejs#1437
1 parent b41a09d commit 66eeb15

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

Diff for: 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`

Diff for: docs/ru/api/options.md

+5
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,11 @@ 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+
:::
179+
175180
## localVue
176181

177182
- Тип: `Vue`

0 commit comments

Comments
 (0)