Test cleanup and fixes [c-d]

This commit is contained in:
Angelos Chalaris
2018-06-18 16:34:04 +03:00
parent 026c65a5e6
commit eb3cb2f928
136 changed files with 805 additions and 484 deletions

View File

@ -5,9 +5,19 @@ const factorial = require('./factorial.js');
test('factorial is a Function', () => {
expect(factorial).toBeInstanceOf(Function);
});
t.equal(factorial(6), 720, "Calculates the factorial of 720");
t.equal(factorial(0), 1, "Calculates the factorial of 0");
t.equal(factorial(1), 1, "Calculates the factorial of 1");
t.equal(factorial(4), 24, "Calculates the factorial of 4");
t.equal(factorial(10), 3628800, "Calculates the factorial of 10");
test('Calculates the factorial of 720', () => {
expect(factorial(6)).toBe(720)
});
test('Calculates the factorial of 0', () => {
expect(factorial(0)).toBe(1)
});
test('Calculates the factorial of 1', () => {
expect(factorial(1)).toBe(1)
});
test('Calculates the factorial of 4', () => {
expect(factorial(4)).toBe(24)
});
test('Calculates the factorial of 10', () => {
expect(factorial(10)).toBe(3628800)
});