Skip to content

Latest commit

 

History

History
26 lines (18 loc) · 527 Bytes

createWrapper.md

File metadata and controls

26 lines (18 loc) · 527 Bytes

createWrapper(node [, options])

  • Arguments:

    • {vm|HTMLElement} node
    • {Object} options
      • {Boolean} sync
      • {Boolean} attachedToDocument
  • Returns:

    • {Wrapper}
  • Usage:

createWrapper creates a Wrapper for a mounted Vue instance, or an HTML element.

import { createWrapper } from '@vue/test-utils'
import Foo from './Foo.vue'

const Constructor = Vue.extend(Foo)
const vm = new Constructor().$mount()
const wrapper = createWrapper(vm)
expect(wrapper.vm.foo).toBe(true)