I'm using Karma with Jasmine for my javascript unit tests. Suppose I have a failing test like this:
expect(objectA).toEqual(expectedObjectA);
When it fails, I see the two objects dumped on the console and a message telling me the objects are not equal:
This is not very helpful because in order to find out why they are not equal, I have to to copy paste the text from the console, split the two objects from that object dump, format them, put them in a diff editor. (Sometimes even that doesn't help because the object are not equal because they have members which are functions).
Is there a way to make jasmine dump to the console the exact name and value of the first property that differs between the two objects?
Is there a way to see the object dump pretty printed? (not really necessary, but it would be nicer than this unreadable dump)