Skip to content

Commit 7027515

Browse files
committed
Add tests for ProjectEuler problem 20 (Jest).
1 parent 7121a6d commit 7027515

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Project-Euler/test/Problem020.test.js

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
const factorialDigitSum = require('../Problem020')
2+
3+
describe('Check Problem 20 - Factorial digit sum', () => {
4+
it('Factorial digit sum of 10!', () => {
5+
expect(factorialDigitSum(10)).toBe(27)
6+
})
7+
8+
it('Factorial digit sum of 100!', () => {
9+
expect(factorialDigitSum()).toBe(648)
10+
expect(factorialDigitSum(100)).toBe(648)
11+
})
12+
13+
it('Factorial digit sum of 1000!', () => {
14+
expect(factorialDigitSum(1000)).toBe(10539)
15+
})
16+
})

0 commit comments

Comments
 (0)