mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-06 01:18:23 +08:00
12 lines
373 B
JavaScript
12 lines
373 B
JavaScript
import { sumOfGeometricProgression } from '../SumOfGeometricProgression'
|
|
|
|
describe('Sum Of Geometric Progression', () => {
|
|
it('should return the sum of a finite GP', () => {
|
|
expect(sumOfGeometricProgression(100, 1.5, 4)).toBe(812.5)
|
|
})
|
|
|
|
it('should return the sum of an infinite GP', () => {
|
|
expect(sumOfGeometricProgression(2, 0.5, Infinity)).toBe(4)
|
|
})
|
|
})
|