enzymejs / enzymejs/enzyme

hobgoblin: .html() output for <hr/> differs for shallow() vs. render()

Open
#294 8 comments 0 reactions 0 assignees View on GitHub
help wanted
Dominant language
JavaScript
Stars
19.8k
Forks
2k
PR merge metrics
No merged PRs in 30d

Description

Testing a minor component that renders only `


`. I was attempting to evaluate testing with outputs from shallow() vs. render() when I found differences in the results from .html().

The shallow renderer's `shallowWrapper.html()` returns `


`

The static renderer's `renderWrapper.html()` returns `


`

Is static rendering with cheerio causing the strange "how do we represent self-closing elements" differences?

Is there a mention in the docs that nothing is guaranteed about outputs from `.html()` and `.text()`?

Is there a stated/doced bias for which renderer to prefer?

Should I tell my [consistency hobgoblin](https://en.wikiquote.org/wiki/Consistency) to go join the troll under the nearest bridge?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.