mirror of
https://github.com/10h30/odin-javascript-exercises.git
synced 2026-07-16 21:23:23 +09:00
zero factorial is 1
This commit is contained in:
@@ -56,7 +56,7 @@ describe('power', function() {
|
|||||||
|
|
||||||
describe('factorial', function() {
|
describe('factorial', function() {
|
||||||
it('computes the factorial of 0', 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() {
|
it('computes the factorial of 1', function() {
|
||||||
@@ -74,4 +74,4 @@ describe('factorial', function() {
|
|||||||
it('computes the factorial of 10', function() {
|
it('computes the factorial of 10', function() {
|
||||||
expect(calculator.factorial(10)).toEqual(3628800);
|
expect(calculator.factorial(10)).toEqual(3628800);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user