Skip to content

Latest commit

 

History

History
38 lines (23 loc) · 564 Bytes

getNode.md

File metadata and controls

38 lines (23 loc) · 564 Bytes

.getNode() => ReactElement

Returns the wrapper's underlying node.

If the current wrapper is wrapping the root component, returns the root component's latest render output.

Returns

ReactElement: The retrieved node.

Examples

const element = (
	<div>
		<span />
		<span />
	</div>
);

class MyComponent extends React.Component {
	render() {
		return element;
	}
}

const wrapper = shallow(<MyComponent />);
expect(wrapper.getNode()).to.equal(element);

Related Methods