Skip to content

Commit

Permalink
test: improve clone() test expectation
Browse files Browse the repository at this point in the history
Signed-off-by: Jérôme Benoit <[email protected]>
  • Loading branch information
Jérôme Benoit committed Feb 13, 2024
1 parent 3fad0de commit cfab8dc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/utils/Utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,10 @@ await describe('Utils test suite', async () => {
expect(clone(url)).toStrictEqual({})
const map = new Map([['1', '2']])
expect(clone(map)).toStrictEqual(map)
expect(clone(map) === map).toBe(false)
const set = new Set(['1'])
expect(clone(set)).toStrictEqual(set)
expect(clone(set) === set).toBe(false)
const weakMap = new WeakMap([[{ 1: 1 }, { 2: 2 }]])
expect(() => clone(weakMap)).toThrow(new Error('#<WeakMap> could not be cloned.'))
const weakSet = new WeakSet([{ 1: 1 }, { 2: 2 }])
Expand Down

0 comments on commit cfab8dc

Please sign in to comment.