Skip to content

Commit f06bdd8

Browse files
authored
tests(library/math): clarifies labels for greatestCommonDivisor suite (#543)
- sets precedent for the tests that will follow - facilitates #542
1 parent 3ffff81 commit f06bdd8

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/library/math/operator/constructive/greatestCommonDivisor.test.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,28 @@ import {
1111
describe(greatestCommonDivisor, () => {
1212
describe('the sad outcomes', () => {
1313
describe('when delegated', () => {
14-
it.each([
14+
const combosOfInoperableNumbers = [
1515
[NaN, 100],
1616
[NaN, NaN],
1717
[100, NaN],
18-
])('should reject inoperable operands', (operandA, operandB) => {
18+
] as const;
19+
20+
it.each(combosOfInoperableNumbers)('should reject inoperable operands', (...$0) => {
1921
expect.assertions(1);
2022

21-
expect(() => greatestCommonDivisor(operandA, operandB)).toThrow(Error);
23+
expect(() => greatestCommonDivisor(...$0)).toThrow(Error);
2224
});
2325

24-
it.each([
26+
const combosOfInfiniteNumbers = [
2527
[Infinity, 10000000],
2628
[Infinity, Infinity],
2729
[10000000, Infinity],
28-
])('should reject infinite operands', (operandA, operandB) => {
30+
] as const;
31+
32+
it.each(combosOfInfiniteNumbers)('should reject infinite operands', (...$0) => {
2933
expect.assertions(1);
3034

31-
expect(() => greatestCommonDivisor(operandA, operandB)).toThrow(Error);
35+
expect(() => greatestCommonDivisor(...$0)).toThrow(Error);
3236
});
3337
});
3438

0 commit comments

Comments
 (0)