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 1ea7a5c

Browse files
authored
test: add missing test for SumOfGeometricProgression (TheAlgorithms#1607)
1 parent 10febce commit 1ea7a5c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

‎Maths/test/SumOfGeometricProgression.test.js‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,8 @@ describe('Sum Of Geometric Progression', () => {
88
it('should return the sum of an infinite GP', () => {
99
expect(sumOfGeometricProgression(2, 0.5, Infinity)).toBe(4)
1010
})
11+
12+
it('should throw when series diverges', () => {
13+
expect(() => sumOfGeometricProgression(1, 1, Infinity)).toThrowError()
14+
})
1115
})

0 commit comments

Comments
(0)

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