Skip to content

Commit ddafcf7

Browse files
authored
tests(library/math): asserts that greatestCommonDivisor should take valid operands (#544)
1 parent 649b7b5 commit ddafcf7

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

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

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,14 @@ const symmetricPairCombos = <
4545
});
4646

4747
describe(greatestCommonDivisor, () => {
48-
describe('the sad outcomes', () => {
49-
const primeA = 2;
48+
const singleDigitPrimes = [2, 3, 5, 7] as const;
49+
50+
const [
51+
primeA,
52+
primeB,
53+
] = singleDigitPrimes;
5054

55+
describe('the sad outcomes', () => {
5156
describe('when delegated', () => {
5257
const combosOfInoperableNumbers = symmetricPairCombos({
5358
of : numberTaxonomy.undefined,
@@ -118,7 +123,11 @@ describe(greatestCommonDivisor, () => {
118123
});
119124

120125
describe('the happy outcomes', () => {
121-
it.todo('should accept valid operands');
126+
it('should accept valid operands', () => {
127+
expect.assertions(1);
128+
129+
expect(() => greatestCommonDivisor(primeA, primeB)).not.toThrow();
130+
});
122131

123132
it.todo('should return the same answer regardless of the sign of each operand');
124133

0 commit comments

Comments
 (0)