test: add missing test for SumOfGeometricProgression (#1607)

This commit is contained in:
Piotr Idzik
2024-02-14 16:43:38 +01:00
committed by GitHub
parent 10febce31a
commit 1ea7a5cd5e

View File

@ -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()
})
})