mirror of
https://github.com/renovatebot/renovate.git
synced 2026-10-24 14:34:21 +00:00
930cf6633c
fix: Additional vi.mock path corrections and prettier formatting
18 lines
563 B
TypeScript
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]);
|
|
});
|
|
});
|