Skip to content

Latest commit

 

History

History
21 lines (11 loc) · 409 Bytes

instance.md

File metadata and controls

21 lines (11 loc) · 409 Bytes

.instance() => ReactComponent

Gets the instance of the component being rendered as the root node passed into mount().

NOTE: can only be called on a wrapper instance that is also the root instance.

Returns

ReactComponent: The component instance.

Example

const wrapper = mount(<MyComponent />);
const inst = wrapper.instance();
expect(inst).to.be.instanceOf(MyComponent);