Skip to content

Commit 1ea7a5c

Browse files
authored
test: add missing test for SumOfGeometricProgression (TheAlgorithms#1607)
1 parent 10febce commit 1ea7a5c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Maths/test/SumOfGeometricProgression.test.js

+4
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,8 @@ describe('Sum Of Geometric Progression', () => {
88
it('should return the sum of an infinite GP', () => {
99
expect(sumOfGeometricProgression(2, 0.5, Infinity)).toBe(4)
1010
})
11+
12+
it('should throw when series diverges', () => {
13+
expect(() => sumOfGeometricProgression(1, 1, Infinity)).toThrowError()
14+
})
1115
})

0 commit comments

Comments
 (0)