A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://enzymejs.github.io/enzyme/docs/api/ShallowWrapper/html.html below:

html() ยท Enzyme

.html() => String

Returns a string of the rendered HTML markup of the entire current render tree (not just the shallow-rendered part). It uses static rendering internally. To see only the shallow-rendered part use .debug().

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

Returns

String: The resulting HTML string

Examples
function Foo() {
  return (<div className="in-foo" />);
}
function Bar() {
  return (
    <div className="in-bar">
      <Foo />
    </div>
  );
}
const wrapper = shallow(<Bar />);
expect(wrapper.html()).to.equal('<div class="in-bar"><div class="in-foo"></div></div>');
expect(wrapper.find(Foo).html()).to.equal('<div class="in-foo"></div>');
const wrapper = shallow(<div><b>important</b></div>);
expect(wrapper.html()).to.equal('<div><b>important</b></div>');

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4