Skip to content

Commit 22e194e

Browse files
committed
Add tests for ProjectEuler problem 16 (Jest).
1 parent a9e2661 commit 22e194e

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Project-Euler/test/Problem016.test.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
const powerDigitSum = require('../Problem016')
2+
3+
describe('Check Problem 16 - Power digit sum', () => {
4+
it('Power digit sum of 2^15', () => {
5+
expect(powerDigitSum(2, 15)).toBe(26)
6+
})
7+
8+
it('Power digit sum of 2^1000', () => {
9+
expect(powerDigitSum()).toBe(1366)
10+
expect(powerDigitSum(2, 1000)).toBe(1366)
11+
})
12+
13+
it('Power digit sum of 3^5000', () => {
14+
expect(powerDigitSum(3, 5000)).toBe(11097)
15+
})
16+
})

0 commit comments

Comments
 (0)