wymeditor/wymeditor — pull request #500 by mightyiam (2014-05-04 19:01:51+00:00)
Title: Beautified HTML in unit tests

Added a second assertion to each `wymEqual` call that compares beautified versions of
the actual and expected HTML strings.

I think that this should be a second assertion because it is a form of processing the operands. We should always have the original comparison, as unaltered as possible.

Benchmarks
==========

These benchmarks are not very accurate but they provide a sense of the impact of this change.

Browser | Assertions in '[master](https://github.com/wymeditor/wymeditor/commit/224a79877447b39b0dc0940c9f45f4f5ef8e6d97)' | Duration (ms) in 'master' | Assertions in '[beautified...](https://github.com/mightyiam/wymeditor/commit/5837a6182c428ea9e47d87dbe41a4d750945c539)' | Assertions increase | Duration (ms) in 'beautified...' | Duration increase
--- | --- | --- | --- | --- | --- | ---
Chromium 34 | 948 | 4958 | 1584 | 67% | 7563 | 53%
Firefox 29 | 1000 | 6272 | 1636 | 64% | 9620 | 53%
IE7 | 863 | 282098 | 1424 | 65% | 274687 | less?!
IE10 | 922 | 19465 | 1553 | 68% | 22292 | 15%

The duration increase is a reasonable price to pay for beautified HTML.