Additional tests

This commit is contained in:
Angelos Chalaris
2018-10-31 20:41:38 +02:00
parent 53151c01e5
commit abd66ccc0a
5 changed files with 21 additions and 1 deletions

View File

@ -19,3 +19,8 @@ test('Calculates the factorial of 4', () => {
test('Calculates the factorial of 10', () => {
expect(factorial(10)).toBe(3628800);
});
test('Throws TypeError if n < 0', () => {
expect(() => {
factorial(-1);
}).toThrow(TypeError);
});