Closed developit closed 8 years ago
Hi there,
It would appear that the recently released String diffing support diffs JSON-encoded strings. This seems unintentional.
Here is a reproduction:
expect(`a b`).to.eql(`b a`);
The above produces this output:
Since this appears to be JSON-encoded, I tried manually parsing the expected and actual values around line 369:
err.actual = JSON.parse(err.actual); err.expected = JSON.parse(err.expected);
With this in place, the output is correct:
Is it possible that somewhere within the chai -> mocha -> karma -> karma-mocha-reporter stack, something is stringifying the actual and expected properties?
actual
expected
Submitted a PR for the fix that worked for me, though I can't be sure it's universally workable.
Hi there,
It would appear that the recently released String diffing support diffs JSON-encoded strings. This seems unintentional.
Here is a reproduction:
The above produces this output:
Since this appears to be JSON-encoded, I tried manually parsing the expected and actual values around line 369:
With this in place, the output is correct:
Is it possible that somewhere within the chai -> mocha -> karma -> karma-mocha-reporter stack, something is stringifying the
actual
andexpected
properties?