We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
SumOfGeometricProgression
1 parent 10febce commit 52f811bCopy full SHA for 52f811b
1 file changed
Maths/test/SumOfGeometricProgression.test.js
@@ -1,3 +1,4 @@
1
+import { it } from 'vitest'
2
import { sumOfGeometricProgression } from '../SumOfGeometricProgression'
3
4
describe('Sum Of Geometric Progression', () => {
@@ -8,4 +9,8 @@ describe('Sum Of Geometric Progression', () => {
8
9
it('should return the sum of an infinite GP', () => {
10
expect(sumOfGeometricProgression(2, 0.5, Infinity)).toBe(4)
11
})
12
+
13
+ it('should throw when series diverges', () => {
14
+ expect(() => sumOfGeometricProgression(1, 1, Infinity)).toThrowError()
15
+ })
16
0 commit comments