Show diff only when it helps#802
Conversation
Don't show diff if expected and actual values are completely different and there is nothing in common Fixes qunitjs#335
|
Note: this is a follow up to #786 and also address an issue introduced on the last changes showing a whacky |
|
Seems like the test timed out. |
|
it worked now |
|
Ping. |
|
The hack to show true/false differently is bad. This is likely to blow up with a similar combination of single word pairs, or maybe with numbers. We want to character-by-character diff for syntax, but maybe not for literals like booleans? Since we already landed the new diff, can we keep the "show diff only when it helps" and "show better diff for booleans" apart? |
|
the regexp works only for Booleans, as strings are represented between double quotes and the regexp will search from the start to the end of the value: |
|
btw, |
|
as told on the biweekly meeting, the boolean regexp check is good as-is and @jzaefferer agreed to land it. |
|
Great. So this PR is ready to be merged? |
|
LGTM, I'll just wait for @jzaefferer 👍 here to confirm. Then I'll squash the commits and merge them. |
There was a problem hiding this comment.
Let's fix the <code>QUnit.dump.maxDepth</code> to use QUnit.config.maxDepth as well.
There was a problem hiding this comment.
I just tried to change it to QUnit.config.maxDepth but strangely it din't work, whereas using QUnit.dump.maxDepth works fine. I guess this is happening because dump.maxDepth is initialized with default config.maxDepth in file dump.js and then the value of config.maxDepth is changed. Hence I got a message which looks like:
Diff suppressed as the depth of object is more than current max depth (infinity)
However specifying maxDepth in GET parameters works fine because if parameters are present, the value of config.maxDepth is updated in file core.js before initialization in dump.js.
|
Noticed two things, not sure why I missed them before. |
|
Squashed the two commits into one and merged. Thanks again! |

Follow up of #786