Content-Length: 257272 | pFad | http://github.com/dtphi/TheAlgorithmJavaScript/commit/1ea7a5cd5e455011a26b07b7e43b9c5471e1e501

22 test: add missing test for `SumOfGeometricProgression` (#1607) · dtphi/TheAlgorithmJavaScript@1ea7a5c · GitHub
Skip to content

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)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/dtphi/TheAlgorithmJavaScript/commit/1ea7a5cd5e455011a26b07b7e43b9c5471e1e501

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy