CS2613/labs/L11/spec/deep-equal.spec.js
2022-10-24 08:44:46 -03:00

16 lines
476 B
JavaScript

describe("equal", function () {
let obj = {here: {is: "an"}, object: 2};
it("self", function () {
expect(deepEqual(obj,obj)).toBe(true);
});
it("null", function () {
expect(deepEqual(null,null)).toBe(true);
});
it("different", function () {
expect(deepEqual(obj, {here: 1, object: 2})).toBe(false);
});
it("equivalent", function () {
expect(deepEqual(obj, {here: {is: "an"}, object: 2})).toBe(true);
});
});