Add tests for ProjectEuler problem 16 (Jest).

This commit is contained in:
Eric Lavault
2021-10-05 18:11:21 +02:00
parent a9e2661dcd
commit 22e194ed39

View File

@ -0,0 +1,16 @@
const powerDigitSum = require('../Problem016')
describe('Check Problem 16 - Power digit sum', () => {
it('Power digit sum of 2^15', () => {
expect(powerDigitSum(2, 15)).toBe(26)
})
it('Power digit sum of 2^1000', () => {
expect(powerDigitSum()).toBe(1366)
expect(powerDigitSum(2, 1000)).toBe(1366)
})
it('Power digit sum of 3^5000', () => {
expect(powerDigitSum(3, 5000)).toBe(11097)
})
})