Better string and object diffs
Any idea where one would start on the path to fixing this?
@Whoaa512 Thanks!
With this power-assert-runtime project, I'm going to provide a way to power-assert users to create original renderer by themselves.
Developer documentation does not exist yet (sorry), however you will be able to create your pretty-diff renderer like power-assert-renderer-comparison and configure it through power-assert-context-formatter. If you have created a nice one, please contribute us!
I think it would be great if we were able to build some understanding into the renderer for object diffs and the graph:
var x = {a: 'a', b: 'b', c: 'c', ....lotsMoreProperties};
var y = {a: 'a', b: 'b', c: 'notC', ....lotsMoreProperties};
t.deepEqual(x, y);
Should produce:
t.deepEqual(x, y);
| |
| {c: 'notC', ...}
{c: 'c', ...}
In other words, if it's possible, show where objects differ right in the graph, the ... portion can represent how they are the same.
Perhaps we can use color codes. Green ... means no diff was omitted. Red ... means there was a diff to large to be shown in the graph (at which point we add the more conventional multi-line diff below).
@jamestalmage Ah, that's nice to have!
The best object diff I've seen to date is the one produced by unexpectedjs. In not sure if that code is really reusable, but I recommend taking a look
@Munter Thanks!