mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-04 15:39:42 +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', () => {
|
||||
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