Commit a5c0e04
fix: Fix clone issue with vue.extend components (#115)
- Moving the previous extend fix logic out to `mount` and `shallow`
hooks fixes cloning of component
```js
import { mount } from 'vue-test-utils'
import ContainerTest from 'container/Test.vue'
const options = {
mocks: { $route: 'test' }
}
const wrapper = mount(ContainerTest, options)
console.log(wrapper.vm.$route) // test
const wrapper2 = mount(ContainerTest)
console.log(wrapper2.vm.$route) // test
```
```js
import { mount } from 'vue-test-utils'
import ContainerTest from 'container/Test.vue'
const options = {
mocks: { $route: 'test' }
}
const wrapper = mount(ContainerTest, options)
console.log(wrapper.vm.$route) // test
const wrapper2 = mount(ContainerTest)
console.log(wrapper2.vm.$route) // undefined
```1 parent e671676 commit a5c0e04
3 files changed
+3
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
0 commit comments