Test cleanup and fixes [e-f]

This commit is contained in:
Angelos Chalaris
2018-06-18 16:44:12 +03:00
parent eb3cb2f928
commit dcc4556878
27 changed files with 132 additions and 194 deletions

View File

@ -1,23 +1,21 @@
const expect = require('expect');
const factorial = require('./factorial.js');
test('factorial is a Function', () => {
test('factorial is a Function', () => {
expect(factorial).toBeInstanceOf(Function);
});
test('Calculates the factorial of 720', () => {
expect(factorial(6)).toBe(720)
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 0', () => {
expect(factorial(0)).toBe(1);
});
test('Calculates the factorial of 1', () => {
expect(factorial(1)).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 4', () => {
expect(factorial(4)).toBe(24);
});
test('Calculates the factorial of 10', () => {
expect(factorial(10)).toBe(3628800)
test('Calculates the factorial of 10', () => {
expect(factorial(10)).toBe(3628800);
});