Passed tests 8 and 9 from exercise 10

This commit is contained in:
NetMan 2024-01-11 21:39:13 +01:00
parent 7c157bdc29
commit f49cd7df96
2 changed files with 8 additions and 2 deletions

View File

@ -1,4 +1,10 @@
const fibonacci = function(number) {
if (number == 0) {
return 0;
}
if (number < 0) {
return "OOPS";
}
let a = 1, b = 1;
let sum = a;
for (let i = 0;

View File

@ -22,10 +22,10 @@ describe('fibonacci', () => {
test('2nd fibonacci number is 1', () => {
expect(fibonacci(2)).toBe(1);
});
test.skip('0th fibonacci number is 0', () => {
test('0th fibonacci number is 0', () => {
expect(fibonacci(0)).toBe(0);
});
test.skip('doesn\'t accept negatives', () => {
test('doesn\'t accept negatives', () => {
expect(fibonacci(-25)).toBe("OOPS");
});
test.skip('DOES accept strings', () => {