Skip to content

Commit a6767ba

Browse files
authored
Create WhileLoopFactorial.test.js
The test was not present previously.
1 parent d5f866c commit a6767ba

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

Maths/test/WhileLoopFactorial.test.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { factorialize } from '../WhileLoopFactorial'
2+
3+
test('Testing on 3!', () => {
4+
const three_factorial = factorialize(3)
5+
expect(three_factorial).toBe(6)
6+
})
7+
8+
test('Testing on 7!', () => {
9+
const seven_factorial = factorialize(7)
10+
expect(seven_factorial).toBe(5040)
11+
})
12+
13+
test('Testing on 0!', () => {
14+
const zero_factorial = factorialize(0)
15+
expect(zero_factorial).toBe(1)
16+
})
17+
18+
test('Testing on 12!', () => {
19+
const twelve_factorial = factorialize(12)
20+
expect(twelve_factorial).toBe(479001600)
21+
})

0 commit comments

Comments
 (0)