File tree 4 files changed +20
-12
lines changed
4 files changed +20
-12
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,9 @@ setData works by recursively calling Vue.set.
16
16
import { mount } from ' @vue/test-utils'
17
17
import Foo from ' ./Foo.vue'
18
18
19
- const wrapper = mount (Foo)
20
- wrapper .setData ({ foo: ' bar' })
21
- expect (wrapper .vm .foo ).toBe (' bar' )
19
+ test (' setData demo' , async () => {
20
+ const wrapper = mount (Foo)
21
+ await wrapper .setData ({ foo: ' bar' })
22
+ expect (wrapper .vm .foo ).toBe (' bar' )
23
+ })
22
24
```
Original file line number Diff line number Diff line change @@ -16,7 +16,9 @@ setData は再帰的に Vue.set を実行することで動作します。
16
16
import { mount } from ' @vue/test-utils'
17
17
import Foo from ' ./Foo.vue'
18
18
19
- const wrapper = mount (Foo)
20
- wrapper .setData ({ foo: ' bar' })
21
- expect (wrapper .vm .foo ).toBe (' bar' )
19
+ test (' setData demo' , async () => {
20
+ const wrapper = mount (Foo)
21
+ await wrapper .setData ({ foo: ' bar' })
22
+ expect (wrapper .vm .foo ).toBe (' bar' )
23
+ })
22
24
```
Original file line number Diff line number Diff line change @@ -18,7 +18,9 @@ setData работает путём слияния существующих св
18
18
import { mount } from ' @vue/test-utils'
19
19
import Foo from ' ./Foo.vue'
20
20
21
- const wrapper = mount (Foo)
22
- wrapper .setData ({ foo: ' bar' })
23
- expect (wrapper .vm .foo ).toBe (' bar' )
21
+ test (' setData demo' , async () => {
22
+ const wrapper = mount (Foo)
23
+ await wrapper .setData ({ foo: ' bar' })
24
+ expect (wrapper .vm .foo ).toBe (' bar' )
25
+ })
24
26
```
Original file line number Diff line number Diff line change 16
16
import { mount } from ' @vue/test-utils'
17
17
import Foo from ' ./Foo.vue'
18
18
19
- const wrapper = mount (Foo)
20
- wrapper .setData ({ foo: ' bar' })
21
- expect (wrapper .vm .foo ).toBe (' bar' )
19
+ test (' setData demo' , async () => {
20
+ const wrapper = mount (Foo)
21
+ await wrapper .setData ({ foo: ' bar' })
22
+ expect (wrapper .vm .foo ).toBe (' bar' )
23
+ })
22
24
```
You can’t perform that action at this time.
0 commit comments