HTML Reporter: Show diff only when it helps#786
Conversation
Don't show diff if expected and actual values are completely different and there is nothing in common Fixes qunitjs#335
|
This is also something I'd like to evaluate after we've landed a new diff implementation (#772), since that is very likely to affect this optimization. |
|
Output with new diff library (Google diff patch match): I think this PR is still valid. In case of completely different output no diff is displayed. However even if one character is same, diff is displayed. What do you think @jzaefferer ? |
|
There's only one thing missing here, maybe introduced by the recent changes: we need to check and ommit the diff when one of the values (actual or expected) is a boolean. The diff: falstrue is awful. |
|
@leobalter Yes, I agree. Showing diff for boolean don't make much sense. |
|
I've got that branch rebased and did the other commit checking the boolean value. |
|
Looks good to me. Created a new PR. Ref #802 |
|
You could have updated your branch, but let's move on the new PR now. |

Don't show diff if expected and actual values are completely different and there is nothing in common.
However when working with two different arrays or objects, the braces remains common because of which the length changes and diff is displayed. Is this behavior accepted? It works fine if we compare object and array. Screenshot attached:
Fixes #335