render() · Enzyme (original) (raw)
- Table of Contents
- Introduction
- Guides
- Installation
- API Reference
- Change Log
- Future
- Contributing Guide
- Published with GitBook
.render() => CheerioWrapper
Returns a CheerioWrapper around the rendered HTML of the single node's subtree. It must be a single-node wrapper.
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 = mount(<Bar />);
expect(wrapper.find(Foo).render().find('.in-foo')).to.have.lengthOf(1);