I'm trying to make prettier HTML for my tests so that they are easy to read. This means I want to write them as template strings.
The problem is that tools do not output template strings, instead giving me diffs like this:
"'\\n<ul class=\"list\">\\n <li class=\"list-item\">\\n <input\\n type=\"radio\"\\n checked=\"\"\\n name=\"item\"\\n value=\"1\"\\n />\\n </li>\\n</ul>\\n'"
Which I would like to see as:
`
<ul class="list">
<li class="list-item">
<input
type="radio"
checked=""
name="item"
value="1"
/>
</li>
</ul>
`
I could write a custom solution but is there an existing tool for this?
Top comments (2)
The poor man's solution... open Codepen and throw these codes:
.
Could automate more. Also noticed that apparently my setup for
tap-nirvana
isn't probably working right as I'm gettingdeepEqual
comparisons in a very unfriendly syntax and the whole purpose fortap-nirvana
is to give me pretty colors and diffs.Replaced
tap-nirvana
withtap-difflet
and no more issues with double escaped strings and diffs are easier to read :)