Skip to content

Latest commit

 

History

History
25 lines (16 loc) · 473 Bytes

hasProp.md

File metadata and controls

25 lines (16 loc) · 473 Bytes

hasProp(prop, value)

Assert Wrapper vm has prop matching value.

Returns true if Wrapper vm has prop matching value.

Note: the Wrapper must contain a Vue instance.

  • Arguments:

    • {string} prop
    • {any} value
  • Returns: {boolean}

  • Example:

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

const wrapper = mount(Foo)
expect(wrapper.hasProp('bar', 10)).toBe(true)