From b65de75cad68213ce84995aaff10f8ab5e2618d5 Mon Sep 17 00:00:00 2001 From: Piotr Idzik Date: Sun, 11 Feb 2024 10:51:28 +0000 Subject: [PATCH] test: cleanup `square_root.test.ts` --- maths/test/square_root.test.ts | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/maths/test/square_root.test.ts b/maths/test/square_root.test.ts index 3dbd8658..366f867c 100644 --- a/maths/test/square_root.test.ts +++ b/maths/test/square_root.test.ts @@ -9,20 +9,16 @@ describe("squareRoot", () => { ); test.each([0, 1, 4, 9, 16, 25])( - "should return correct rational square root value", - () => { - (n: number) => { - expect(() => squareRoot(n)).toBeCloseTo(Math.sqrt(n)); - }; + "should return correct rational square root value for %i", + (n: number) => { + expect(squareRoot(n)).toBeCloseTo(Math.sqrt(n)); } ); test.each([2, 15, 20, 40, 99, 10032])( - "should return correct irrational square root value", - () => { - (n: number) => { - expect(() => squareRoot(n)).toBeCloseTo(Math.sqrt(n)); - }; + "should return correct irrational square root value %i", + (n: number) => { + expect(squareRoot(n)).toBeCloseTo(Math.sqrt(n)); } ); });