Files
30-seconds-of-code/test/sumPower/sumPower.test.js
2018-06-18 16:34:04 +03:00

18 lines
549 B
JavaScript

const expect = require('expect');
const sumPower = require('./sumPower.js');
test('sumPower is a Function', () => {
expect(sumPower).toBeInstanceOf(Function);
});
test('Returns the sum of the powers of all the numbers from start to end', () => {
expect(sumPower(10)).toBe(385)
});
test('Returns the sum of the powers of all the numbers from start to end', () => {
expect(sumPower(10, 3)).toBe(3025)
});
test('Returns the sum of the powers of all the numbers from start to end', () => {
expect(sumPower(10, 3, 5)).toBe(2925)
});