Skip to content

Commit ff285ec

Browse files
authored
test(compat/array/intersectionBy): add test case for invalid iteratee type handling (#1501)
1 parent c1025a2 commit ff285ec

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/compat/array/intersectionBy.spec.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,14 @@ describe('intersectionBy', () => {
139139
]);
140140
});
141141

142+
it('should handle non-function, non-string, non-array iteratee', () => {
143+
const array1 = [1, 2, 3];
144+
const array2 = [2, 3, 4];
145+
146+
const actual = intersectionBy(array1, array2, 123);
147+
expect(actual).toEqual([1, 2, 3]);
148+
});
149+
142150
it('should match the type of lodash', () => {
143151
expectTypeOf(intersectionBy).toEqualTypeOf<typeof intersectionByLodash>();
144152
});

0 commit comments

Comments
 (0)