From b8966986df5b6d1dab95965ce0d35498c725b59e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Feje=C5=A1?= Date: Mon, 15 Jan 2018 20:52:23 +0100 Subject: [PATCH] add few tests for factorial including edge cases --- test/factorial/factorial.test.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/factorial/factorial.test.js b/test/factorial/factorial.test.js index 6b67865ea..6eb4467ff 100644 --- a/test/factorial/factorial.test.js +++ b/test/factorial/factorial.test.js @@ -5,7 +5,11 @@ test('Testing factorial', (t) => { //For more information on all the methods supported by tape //Please go to https://github.com/substack/tape t.true(typeof factorial === 'function', 'factorial is a Function'); - // t.equal(factorial(6), 720, "Calculates the factorial of a number"); DOESN'T WORK + 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"); //t.deepEqual(factorial(args..), 'Expected'); //t.equal(factorial(args..), 'Expected'); //t.false(factorial(args..), 'Expected');