Skip to content

Latest commit

 

History

History
27 lines (15 loc) · 561 Bytes

prop.md

File metadata and controls

27 lines (15 loc) · 561 Bytes

.prop(key) => Any

Returns the prop value for the node of the current wrapper with the provided key.

NOTE: can only be called on a wrapper of a single node.

Arguments

  1. key (String): The prop name such that this will return value will be the this.props[key] of the component instance.

Example

const wrapper = mount(<MyComponent foo={10} />);
expect(wrapper.prop('foo')).to.equal(10);

Related Methods