Skip to content

Commit

Permalink
chore: add test case for removing object duplicates
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateusz Tkacz committed Oct 2, 2024
1 parent d7f9882 commit 9b0a477
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/utils/arrayUtils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,13 @@ describe('arrayUtils', () => {
const result = removeDuplicates(array)
expect(result).toEqual([0, 1, '', 'test', true, false])
})

it('should remove all duplicated object instances', () => {
const objA = {}
const objB = {}
const array = [objA, objA, objB]
const result = removeDuplicates(array)
expect(result).toEqual([objA, objB])
})
})
})

0 comments on commit 9b0a477

Please sign in to comment.