mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-05 16:26:47 +08:00
test: add missing test for SumOfGeometricProgression
(#1607)
This commit is contained in:
@ -8,4 +8,8 @@ describe('Sum Of Geometric Progression', () => {
|
|||||||
it('should return the sum of an infinite GP', () => {
|
it('should return the sum of an infinite GP', () => {
|
||||||
expect(sumOfGeometricProgression(2, 0.5, Infinity)).toBe(4)
|
expect(sumOfGeometricProgression(2, 0.5, Infinity)).toBe(4)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('should throw when series diverges', () => {
|
||||||
|
expect(() => sumOfGeometricProgression(1, 1, Infinity)).toThrowError()
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
Reference in New Issue
Block a user