Skip to content

Latest commit

 

History

History
39 lines (24 loc) · 627 Bytes

File metadata and controls

39 lines (24 loc) · 627 Bytes

.getNodes() => Array<ReactElement>

Returns the wrapper's underlying nodes.

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

Returns

Array<ReactElement>: The retrieved nodes.

Examples

const one = <span />;
const two = <span />;

class Test extends React.Component {
	render() {
		return (
			<div>
				{ one }
				{ two }
			</div>
		);
	}
}

const wrapper = shallow(<Test />);
expect(wrapper.find('span').getNodes()).to.deep.equal([one, two]);

Related Methods