From 633228bf94fa727882aac9eab8dfe489629bf2ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B8=D1=85=D0=B0=D0=B8=D0=BB=20=D0=9A=D0=BE=D1=80?= =?UTF-8?q?=D0=BC=D0=B0=D0=BD=D0=BE=D0=B2=D1=81=D0=BA=D0=B8=D0=B9=20=28Mik?= =?UTF-8?q?hail=20Kormanowsky=29?= Date: Thu, 3 Oct 2024 15:07:17 +0300 Subject: [PATCH] add test to spec.ts --- tests/spec.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/spec.ts b/tests/spec.ts index 7580444..45317ae 100644 --- a/tests/spec.ts +++ b/tests/spec.ts @@ -15,4 +15,8 @@ describe('distrib()', () => { ) .toEqual([[1000, 0.06, 0.01], [700, 200, 100, 0.05, 0.02], [500, 500, 0.04, 0.03]]); }); -}); \ No newline at end of file + + test('groups 1 big number, 1 medium and 4 small into 2 groups', () => { + expect(distrib([5, 5, 5, 5, 10, 20], 3)).toEqual([[20, 5], [10, 5, 5]]); + }); +});