postmanlabs / postman-app-support

Postman is an API platform for building and using APIs. Postman simplifies each step of the API lifecycle and streamlines collaboration so you can create better APIs—faster.
https://www.postman.com
5.84k stars 839 forks source link

eql / deep.equal returns unhelpful output when comparing json objects #6353

Open klemens-u opened 5 years ago

klemens-u commented 5 years ago

I posted this @chai and they told me its a postman issue: https://github.com/chaijs/chai/issues/1247

I compare two objects with the eql / deep.equal assertion, and they are not equal. At the momen the return is something like: AssertionError: expected { Object (...) } to deeply equal { Object (...) }

This return is not helpful at all, as there is no reporting on the differences. I would expect something like this:

AssertionError: expected { Object (...) } to deeply equal { Object (...) } + diff like output of (for example) the stringified json representation.

That would make debugging so much easier!

shamasis commented 5 years ago

Agree. Keeping this as feature request.

vicneanschi commented 4 years ago

That would be so much helpful!

flprdrgs commented 4 years ago

Oh I been looking for this one.

Chai’s assertions have a built-in showDiff flag (chai.config.showDiff = true), but does not produce the diff itself, it’s up to the test runner to produce such output.

klemens-u commented 1 year ago

Any news on this?