私は AngularDart チュートリアルに取り組んでおり、演習を完了するときに単体テストを作成しようとしています。
次のようなテストがあります。
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));
}));
テストは次の出力で失敗します。
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]
「categoryFilter」の既存のテストを変更して失敗させようとしたところ、同じ、むしろ役に立たない出力が得られました。
2 つのオブジェクトの比較からの出力をより意味のあるものにする方法はありますか?