Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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)

AltStyle によって変換されたページ (->オリジナル) /