Skip to content

Commit 89f6c8f

Browse files
authored
test(compat/array/pullAllWith): add test case for array-like values parameter (#1413)
1 parent 93efba5 commit 89f6c8f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/compat/array/pullAllWith.spec.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,15 @@ describe('pullAllWith', () => {
105105
expect(pullAllWith(undefined, [1, 2, 3])).toEqual(undefined);
106106
});
107107

108+
it('should work with array-like objects as values', () => {
109+
const array = [1, 2, 3, 4];
110+
const arrayLikeValues = { 0: 2, 1: 4, length: 2 };
111+
112+
pullAllWith(array, arrayLikeValues);
113+
114+
expect(array).toEqual([1, 3]);
115+
});
116+
108117
// NOTE: TypeScript doesn't support matching conditional types
109118
// it('should match the type of lodash', () => {
110119
// expectTypeOf(pullAllWith).toEqualTypeOf<typeof pullAllWithLodash>();

0 commit comments

Comments
 (0)