Skip to content

Commit cb63fdd

Browse files
author
m.somov
committed
add deepEqual tests
1 parent 830b04f commit cb63fdd

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/core.spec.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ describe('Задания core js', () => {
106106
});
107107

108108
describe('#deepEqual', () => {
109+
const dummyFunction = () => {};
110+
109111
it('Возвращает true если объекты равны', () => {
110112
assert.equal(
111113
core.deepEqual(
@@ -128,6 +130,15 @@ describe('Задания core js', () => {
128130
),
129131
true
130132
);
133+
assert.equal(
134+
core.deepEqual({func: dummyFunction}, {func: dummyFunction}),
135+
true
136+
);
137+
assert.equal(
138+
core.deepEqual({a: 'a', b: 'b'}, {b: 'b', a: 'a'}),
139+
true
140+
);
141+
assert.equal(core.deepEqual(NaN, NaN), true);
131142
});
132143

133144
it('Возвращает false если объекты не равны', () => {
@@ -166,6 +177,10 @@ describe('Задания core js', () => {
166177
assert.strictEqual(core.deepEqual(0, 1), false);
167178
assert.strictEqual(core.deepEqual(null, 0), false);
168179
assert.strictEqual(core.deepEqual(null, undefined), false);
180+
assert.equal(
181+
core.deepEqual({func: dummyFunction}, {func: () => {}}),
182+
false
183+
);
169184
});
170185
});
171186
});

0 commit comments

Comments
 (0)