Skip to content

Commit

Permalink
docs: update setData docs to reflect async mode
Browse files Browse the repository at this point in the history
  • Loading branch information
AtofStryker committed Aug 16, 2020
1 parent 6ffe5bc commit bfb24df
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 12 deletions.
8 changes: 5 additions & 3 deletions docs/api/wrapper/setData.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ setData works by recursively calling Vue.set.
import { mount } from '@vue/test-utils'
import Foo from './Foo.vue'

const wrapper = mount(Foo)
wrapper.setData({ foo: 'bar' })
expect(wrapper.vm.foo).toBe('bar')
test('setData demo', async () => {
const wrapper = mount(Foo)
await wrapper.setData({ foo: 'bar' })
expect(wrapper.vm.foo).toBe('bar')
})
```
8 changes: 5 additions & 3 deletions docs/ja/api/wrapper/setData.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ setData は再帰的に Vue.set を実行することで動作します。
import { mount } from '@vue/test-utils'
import Foo from './Foo.vue'

const wrapper = mount(Foo)
wrapper.setData({ foo: 'bar' })
expect(wrapper.vm.foo).toBe('bar')
test('setData demo', async () => {
const wrapper = mount(Foo)
await wrapper.setData({ foo: 'bar' })
expect(wrapper.vm.foo).toBe('bar')
})
```
8 changes: 5 additions & 3 deletions docs/ru/api/wrapper/setData.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ setData работает путём слияния существующих св
import { mount } from '@vue/test-utils'
import Foo from './Foo.vue'

const wrapper = mount(Foo)
wrapper.setData({ foo: 'bar' })
expect(wrapper.vm.foo).toBe('bar')
test('setData demo', async () => {
const wrapper = mount(Foo)
await wrapper.setData({ foo: 'bar' })
expect(wrapper.vm.foo).toBe('bar')
})
```
8 changes: 5 additions & 3 deletions docs/zh/api/wrapper/setData.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
import { mount } from '@vue/test-utils'
import Foo from './Foo.vue'

const wrapper = mount(Foo)
wrapper.setData({ foo: 'bar' })
expect(wrapper.vm.foo).toBe('bar')
test('setData demo', async () => {
const wrapper = mount(Foo)
await wrapper.setData({ foo: 'bar' })
expect(wrapper.vm.foo).toBe('bar')
})
```

0 comments on commit bfb24df

Please sign in to comment.