I'm currently using the Karma test runner for my Angular project, with the jasmine testing framework. It's working great, but I have one issue: When an object comparison fails, the resulting print into the console is really hard to read, and gets harder the more properties these objects have. Example:
Expected spy spy to have been called with [ { currentCareMoment : { ID : 5, Description : 'Late namiddag (16-20)', StartHour : 16, EndHour : 20 }, previousCareMoment : { ID : 4, Description : 'Namiddag (14-16)', StartHour : 14, EndHour : 16 } } ] but actual calls were [ { currentCareMoment : { ID : 6, Description : 'Avond (20-24)', StartHour : 20, EndHour : 24 }, previousCareMoment : { ID : 5, Description : 'Late namiddag (16-20)', StartHour : 16, EndHour : 20 } } ].
Is there anyway to set up Jasmine (as I think Karma has nothing to do with it) to print objects prettier? Just some line breaks and indentation would already be a huge help. Example:
Expected spy spy to have been called with [ {
currentCareMoment : {
ID : 5,
Description : 'Late namiddag (16-20)',
StartHour : 16,
EndHour : 20
},
previousCareMoment : {
ID : 4,
Description : 'Namiddag (14-16)',
StartHour : 14,
EndHour : 16
}
} ] but actual calls were [ {
currentCareMoment : {
ID : 6,
Description : 'Avond (20-24)',
StartHour : 20,
EndHour : 24
},
previousCareMoment : {
ID : 5,
Description : 'Late namiddag (16-20)',
StartHour : 16,
EndHour : 20
}
} ].