Skip to content

Latest commit

 

History

History
20 lines (14 loc) · 369 Bytes

setData.md

File metadata and controls

20 lines (14 loc) · 369 Bytes

setData(data)

Sets Wrapper vm data and forces update.

Note the Wrapper must contain a Vue instance.

  • Arguments:

    • {Object} data
  • Example:

import { mount } from 'vue-test-utils'
import { expect } from 'chai'
import Foo from './Foo.vue'

const wrapper = mount(Foo)
wrapper.setData({ foo: 'bar' })
expect(wrapper.vm.foo).toBe('bar')