I am working through the AngularDart tutorial and trying to write unit tests as I complete the exercises.
I have a test that looks like this:
test('should convert sugar ingredient to maple syrup', inject((SugarFilter filter) {
var r1 = new Recipe(null, null, null, ['has sugar in ingredients '], 'bla', null, null);
var r1New = new Recipe(null, null, null, ['has maple syrup in ingredient '], 'bla', null, null);
var r2 = new Recipe(null, null, null,[ 'has pure ingredients'], 'bla', null, null);
var inList = [r1, r2];
var outList = [r1New, r2];
expect(filter(inList), equals(outList));
}));
The test fails with this output:
Test failed: Caught Expected: [Instance of 'Recipe', Instance of 'Recipe']
Actual: [Instance of 'Recipe', Instance of 'Recipe']
Which: was <Instance of 'Recipe'> instead of <Instance of 'Recipe'> at location [0]
I tried modifying the existing test for 'categoryFilter' to make that fail and I get the same, rather unhelpful output.
Is there a way to make the output from the comparison of two objects more meaningful?