Files
renovate/lib/util/filter-map.spec.ts
Sergei Zharinov 930cf6633c refactor: Rewrite imports with .ts extensions (#40700)
fix: Additional vi.mock path corrections and prettier formatting
2026-01-26 22:48:17 +00:00

18 lines
563 B
TypeScript

import { filterMap } from './filter-map.ts';
describe('util/filter-map', () => {
it('should return an empty array when given an empty array', () => {
const input: unknown[] = [];
const output = filterMap(input, () => 42);
expect(output).toBe(input);
expect(output).toBeEmpty();
});
it('should return an array with only the mapped values that pass the filter', () => {
const input = [0, 1, 2, 3, 4];
const output = filterMap(input, (n) => n * n);
expect(output).toBe(input);
expect(output).toEqual([1, 4, 9, 16]);
});
});