Passed tests 8 and 9 from exercise 10
This commit is contained in:
parent
7c157bdc29
commit
f49cd7df96
|
@ -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;
|
||||
|
|
|
@ -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', () => {
|
||||
|
|
Loading…
Reference in New Issue