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

Lines changed: 16 additions & 0 deletions
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)

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