Skip to content

Latest commit

 

History

History
36 lines (25 loc) · 589 Bytes

render.md

File metadata and controls

36 lines (25 loc) · 589 Bytes

.render() => CheerioWrapper

Returns a CheerioWrapper around the rendered HTML of the current node's subtree.

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

Returns

CheerioWrapper: The resulting Cheerio object

Examples

function Foo() {
  return (<div className="in-foo" />);
}
function Bar() {
  return (
    <div className="in-bar">
      <Foo />
    </div>
  );
}
const wrapper = shallow(<Bar />);
expect(wrapper.find('.in-foo')).to.have.length(0);
expect(wrapper.find(Foo).render().find('.in-foo')).to.have.length(1);