test.each([
{ input: { arr: [1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3] }, output: 2.0 },
{ input: { arr: [6, 2, 7, 5, 1, 2, 0, 3, 10, 2, 5, 0, 5, 5, 0, 8, 7, 6, 8, 0] }, output: 4.0 },
{
input: {
arr: [
6, 0, 7, 0, 7, 5, 7, 8, 3, 4, 0, 7, 8, 1, 6, 8, 1, 1, 2, 4, 8, 1, 9, 5, 4, 3, 8, 5, 10, 8, 6, 6, 1, 0, 6, 10, 8,
2, 3, 4,
],
},
output: 4.77778,
},
])('input: arr = $input.arr', ({ input: { arr }, output }) => {
expect(Math.abs(trimMean(arr) - output) <= 10 ** -5).toEqual(true)
})