Adding spec to cover equality of frozen objects, per GitHub issue #266
This commit is contained in:
@@ -102,6 +102,16 @@ describe("matchersUtil", function() {
|
||||
expect(j$.matchersUtil.equals(emptyArray, emptyObject)).toBe(false);
|
||||
});
|
||||
|
||||
it("passes for equivalent frozen objects (GitHub issue #266)", function() {
|
||||
var a = { foo: 1 },
|
||||
b = {foo: 1 };
|
||||
|
||||
Object.freeze(a);
|
||||
Object.freeze(b);
|
||||
|
||||
expect(j$.matchersUtil.equals(a,b)).toBe(true);
|
||||
});
|
||||
|
||||
it("passes when Any is used", function() {
|
||||
var number = 3,
|
||||
anyNumber = new j$.Any(Number);
|
||||
@@ -110,7 +120,7 @@ describe("matchersUtil", function() {
|
||||
expect(j$.matchersUtil.equals(anyNumber, number)).toBe(true);
|
||||
});
|
||||
|
||||
it("fails when Any is compared to something unexepcted", function() {
|
||||
it("fails when Any is compared to something unexpected", function() {
|
||||
var number = 3,
|
||||
anyString = new j$.Any(String);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user