Closed
Description
What problem does this feature solve?
My team is using @vue/test-utils
for snapshot testing components but the snapshots are hard to parse because the HTML string output from .html()
is not formatted in a readable way. If html()
pretty-printed the HTML it would be a lot easier to review changes to the component-generated HTML.
What does the proposed API look like?
html()
would pretty-print the returned HTML string by default, perhaps using something like https://github.com/prettydiff/prettydiff. If necessary, a user could bypass pretty-printing by passing an option to .html()
, perhaps .html(false)
or .html({ prettyPrint: false })
.