karma-spec-reporter icon indicating copy to clipboard operation
karma-spec-reporter copied to clipboard

Show object diff when chai deepEqual fails - feature request

Open lusarz opened this issue 6 years ago • 3 comments

When an assertion using deep.equals fails, it would be nice to get a detailed output that shows piece by piece what is different between the expected and actual values. Something like:

deep-equals-diff

lusarz avatar Jul 08 '18 09:07 lusarz

Can you provide the dependency for the deepEqual method? Jasmine does not appear to have it, but Chai does. Just want to gather some more information. Thanks!

tmcgee123 avatar Jul 09 '18 23:07 tmcgee123

Sure: https://github.com/chaijs/deep-eql

karma-mocha-reporter has this feature implemented: https://github.com/litixsoft/karma-mocha-reporter/blob/master/index.js#L373 so it may be good inspiration point.

lusarz avatar Jul 10 '18 06:07 lusarz

Would you be willing to put a PR up? There is a little bit of work since we enforce TDD. Thanks for the help, I haven't had as much time to contribute recently. I'm still surprised with the amount of people using this since Webpack is the "future".

tmcgee123 avatar Jul 10 '18 15:07 tmcgee123

Closing as this is old and only one person has commented. Will re-open if someone else requests it or if they have a PR ready to go

tmcgee123 avatar Dec 08 '22 22:12 tmcgee123