1import { findLastIndex, intersecting } from '../array'; 2 3describe(findLastIndex, () => { 4 it('should return the last index of an item based on a given criteria', () => { 5 const array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; 6 const predicate = (item: number) => item % 2 === 0; 7 expect(findLastIndex(array, predicate)).toBe(9); 8 }); 9}); 10 11describe(intersecting, () => { 12 it('should return a list of items that intersect between two given arrays', () => { 13 const a = [1, 2, 3]; 14 const b = [1, 2, 3, 4, 5, 6]; 15 expect(intersecting(a, b)).toEqual([1, 2, 3]); 16 }); 17}); 18