Add test for factorialRecursiveTCO

This commit is contained in:
trainer2001 2021-12-12 15:40:21 +05:30
parent 4ea1ad0bb8
commit 9787af0267

View File

@ -0,0 +1,11 @@
import factorialRecursiveTCO from '../factorialRecursiveTCO';
describe('factorialRecursiveTCO', () => {
it('should calculate factorial', () => {
expect(factorialRecursiveTCO(0)).toBe(1);
expect(factorialRecursiveTCO(1)).toBe(1);
expect(factorialRecursiveTCO(5)).toBe(120);
expect(factorialRecursiveTCO(8)).toBe(40320);
expect(factorialRecursiveTCO(10)).toBe(3628800);
});
});