Skip to content

Commit b64dde2

Browse files
committed
Work-around Safari's behavior with duplicate property with array enumration.
1 parent 4caf248 commit b64dde2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/Each.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,12 +377,16 @@ define([
377377
}));
378378
observable.set("foo", new ObservableArray(new Observable({Name: "Irene Ira"}), new Observable({Name: "John Jacklin"})));
379379
observable.foo.push(new Observable({Name: "Anne Ackerman"}), new Observable({Name: "Ben Beckham"}));
380-
expect(each.discardChanges()).to.deep.equal([[
380+
// Safari 9.1 seems to have property duplication by enumerating an array with a custom property:
381+
// https://gist.github.com/asudoh/c9ea4df348b09dbcfcb0bb518ca88c26
382+
// Which breaks Chai deep-equal assertion.
383+
// Wrapping the expected value with ObservableArray, too. for a work-around.
384+
expect(each.discardChanges()).to.deep.equal([new ObservableArray(
381385
new Observable({Name: "Irene Ira"}),
382386
new Observable({Name: "John Jacklin"}),
383387
new Observable({Name: "Anne Ackerman"}),
384388
new Observable({Name: "Ben Beckham"})
385-
]]);
389+
)]);
386390
dfd.resolve(1);
387391
});
388392
it("Round-trip of formatter/parser", function () {

0 commit comments

Comments
 (0)