From 5c78dc7ebebadaf93fbf1b8da69c6b134669ed0c Mon Sep 17 00:00:00 2001 From: Jakub Broz Date: Mon, 1 Jan 2018 15:56:20 +0100 Subject: [PATCH] zero factorial is 1 --- calculator/calculator.spec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/calculator/calculator.spec.js b/calculator/calculator.spec.js index 29b90af..a8b5564 100644 --- a/calculator/calculator.spec.js +++ b/calculator/calculator.spec.js @@ -56,7 +56,7 @@ describe('power', function() { describe('factorial', function() { it('computes the factorial of 0', function() { - expect(calculator.factorial(0)).toEqual(0); + expect(calculator.factorial(0)).toEqual(1); // 0! = 1 }); it('computes the factorial of 1', function() { @@ -74,4 +74,4 @@ describe('factorial', function() { it('computes the factorial of 10', function() { expect(calculator.factorial(10)).toEqual(3628800); }); -}); \ No newline at end of file +});