Merge pull request #1155 from benchristel/arrays-properties-bug
Make `toEqual` pass for arrays with equivalent properties
This commit is contained in:
@@ -75,6 +75,16 @@ describe("matchersUtil", function() {
|
||||
expect(jasmineUnderTest.matchersUtil.equals(one, two)).toBe(false);
|
||||
});
|
||||
|
||||
it("passes for Arrays with equivalent contents and properties", function() {
|
||||
var one = [1,2,3],
|
||||
two = [1,2,3];
|
||||
|
||||
one.foo = 'bar';
|
||||
two.foo = 'bar';
|
||||
|
||||
expect(jasmineUnderTest.matchersUtil.equals(one, two)).toBe(true);
|
||||
});
|
||||
|
||||
it("passes for Errors that are the same type and have the same message", function() {
|
||||
expect(jasmineUnderTest.matchersUtil.equals(new Error("foo"), new Error("foo"))).toBe(true);
|
||||
});
|
||||
|
||||
@@ -225,7 +225,7 @@ getJasmineRequireObj().matchersUtil = function(j$) {
|
||||
var extraKeys = [];
|
||||
for (var i in allKeys) {
|
||||
if (!allKeys[i].match(/^[0-9]+$/)) {
|
||||
extraKeys.push(key);
|
||||
extraKeys.push(allKeys[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user