Skip to content

Commit 702840b

Browse files
authored
style: improve test names of GetEuclidGCD' (TheAlgorithms#1646)
1 parent bd34e9f commit 702840b

File tree

1 file changed

+19
-22
lines changed

1 file changed

+19
-22
lines changed

Maths/test/GetEuclidGCD.test.js

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,22 @@
11
import { GetEuclidGCD, GetEuclidGCDRecursive } from '../GetEuclidGCD'
22

3-
describe.each([GetEuclidGCD, GetEuclidGCDRecursive])(
4-
'%# GetEuclidGCD',
5-
(gcdFunction) => {
6-
it.each([
7-
[5, 20, 5],
8-
[109, 902, 1],
9-
[290, 780, 10],
10-
[104, 156, 52],
11-
[0, 100, 100],
12-
[-5, 50, 5],
13-
[0, 0, 0],
14-
[1, 1234567, 1]
15-
])('returns correct result for %i and %j', (inputA, inputB, expected) => {
16-
expect(gcdFunction(inputA, inputB)).toBe(expected)
17-
expect(gcdFunction(inputB, inputA)).toBe(expected)
18-
})
3+
describe.each([GetEuclidGCD, GetEuclidGCDRecursive])('%o', (gcdFunction) => {
4+
it.each([
5+
[5, 20, 5],
6+
[109, 902, 1],
7+
[290, 780, 10],
8+
[104, 156, 52],
9+
[0, 100, 100],
10+
[-5, 50, 5],
11+
[0, 0, 0],
12+
[1, 1234567, 1]
13+
])('returns correct result for %i and %j', (inputA, inputB, expected) => {
14+
expect(gcdFunction(inputA, inputB)).toBe(expected)
15+
expect(gcdFunction(inputB, inputA)).toBe(expected)
16+
})
1917

20-
it('should throw when any of the inputs is not a number', () => {
21-
expect(() => gcdFunction('1', 2)).toThrowError()
22-
expect(() => gcdFunction(1, '2')).toThrowError()
23-
})
24-
}
25-
)
18+
it('should throw when any of the inputs is not a number', () => {
19+
expect(() => gcdFunction('1', 2)).toThrowError()
20+
expect(() => gcdFunction(1, '2')).toThrowError()
21+
})
22+
})

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy