Skip to content

Commit

Permalink
Merge branch 'main' into feature/deep-freeze
Browse files Browse the repository at this point in the history
  • Loading branch information
vigan-abd committed Nov 29, 2023
2 parents 366f9bd + cb64fad commit e79eff1
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 e79eff1

Please sign in to comment.