Skip to content

Commit ba92697

Browse files
committed
test: add missing test for SumOfGeometricProgression
1 parent 10febce commit ba92697

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Maths/test/SumOfGeometricProgression.test.js

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { it } from 'vitest'
12
import { sumOfGeometricProgression } from '../SumOfGeometricProgression'
23

34
describe('Sum Of Geometric Progression', () => {
@@ -8,4 +9,8 @@ describe('Sum Of Geometric Progression', () => {
89
it('should return the sum of an infinite GP', () => {
910
expect(sumOfGeometricProgression(2, 0.5, Infinity)).toBe(4)
1011
})
12+
13+
it('should throw when series diverges', () => {
14+
expect(() => sumOfGeometricProgression(1, 1, Infinity)).toThrowError()
15+
})
1116
})

0 commit comments

Comments
 (0)