Updated the test system

This commit is contained in:
Angelos Chalaris
2018-10-10 23:36:17 +03:00
parent 0f334e1431
commit 1edaed51e4
725 changed files with 385 additions and 2332 deletions

21
test/factorial.test.js Normal file
View File

@ -0,0 +1,21 @@
const expect = require('expect');
const {factorial} = require('./_30s.js');
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 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);
});