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

Lines changed: 5 additions & 0 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy