8000 test: cleanup `square_root.test.ts` (#229) · TheAlgorithms/TypeScript@24cbb3b · GitHub
[go: up one dir, main page]

Skip to content

Commit 24cbb3b

Browse files
authored
test: cleanup square_root.test.ts (#229)
1 parent 650d553 commit 24cbb3b

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

maths/test/square_root.test.ts

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,16 @@ describe("squareRoot", () => {
99
);
1010

1111
test.each([0, 1, 4, 9, 16, 25])(
12-
"should return correct rational square root value",
13-
() => {
14-
(n: number) => {
15-
expect(() => squareRoot(n)).toBeCloseTo(Math.sqrt(n));
16-
};
12+
"should return correct rational square root value for %i",
13+
(n: number) => {
14+
expect(squareRoot(n)).toBeCloseTo(Math.sqrt(n));
1715
}
1816
);
1917

2018
test.each([2, 15, 20, 40, 99, 10032])(
21-
"should return correct irrational square root value",
22-
() => {
23-
(n: number) => {
24-
expect(() => squareRoot(n)).toBeCloseTo(Math.sqrt(n));
25-
};
19+
"should return correct irrational square root value %i",
20+
(n: number) => {
21+
expect(squareRoot(n)).toBeCloseTo(Math.sqrt(n));
2622
}
2723
);
2824
});

0 commit comments

Comments
 (0)
0