Skip to content

Commit

Permalink
chore: fix unit test failing in Vitest 2
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtekmaj committed Sep 29, 2024
1 parent 4794200 commit 737252f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/compat/object/cloneDeep.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,13 @@ describe('cloneDeep', () => {
it(`should clone arguments objects`, () => {
const actual = cloneDeep(args);

expect(actual).toEqual(args);
// Arguments objects equality doesn't work properly in Vitest 2, so we need to check the properties manually
expect(actual).toHaveProperty('0', 1);
expect(actual).toHaveProperty('1', 2);
expect(actual).toHaveProperty('2', 3);
expect(actual).toHaveProperty('length', 3);
expect(actual[Symbol.iterator]).toBe(args[Symbol.iterator]);

expect(actual).not.toBe(args);
});

Expand Down

0 comments on commit 737252f

Please sign in to comment.