Skip to content

Commit

Permalink
Added test coverage for isEual code
Browse files Browse the repository at this point in the history
  • Loading branch information
dictor93 committed Nov 29, 2023
1 parent 9dbf5e6 commit 5e0a840
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/isEqual.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,19 @@ describe('isEqual', () => {
false
)
})

it('should return false for comparsion of items with different types', () => {
assert.ok(!isEqual(1, '1'))
assert.ok(!isEqual(1, { }))
assert.ok(!isEqual(false, '5'))
})

it('should return true for nested equal arrays', () => {
const nesrtedArray = [1, 2, 3]
assert.ok(isEqual({ a: [1, 2, nesrtedArray] }, { a: [1, 2, nesrtedArray] }))
})

it('should return false if nested one of nestd item is not array', () => {
assert.ok(!isEqual({ a: [1, 2, [3]] }, { a: [1, 2, 3] }))
})
})

0 comments on commit 5e0a840

Please sign in to comment.