odin-default-js-exercises/10_fibonacci/solution/fibonacci-solution.spec.js

38 lines
1.0 KiB
JavaScript
Raw Normal View History

2023-09-18 21:06:51 +00:00
const fibonacci = require('./fibonacci')
2022-02-20 19:07:44 +00:00
2023-02-01 23:53:54 +00:00
describe('fibonacci', () => {
test('4th fibonacci number is 3', () => {
2023-01-21 17:53:41 +00:00
expect(fibonacci(4)).toBe(3);
});
2023-09-18 21:06:51 +00:00
test.skip('6th fibonacci number is 8', () => {
2023-01-21 17:53:41 +00:00
expect(fibonacci(6)).toBe(8);
});
2023-09-18 21:06:51 +00:00
test.skip('10th fibonacci number is 55', () => {
2023-01-21 17:53:41 +00:00
expect(fibonacci(10)).toBe(55);
});
2023-09-18 21:06:51 +00:00
test.skip('15th fibonacci number is 610', () => {
2023-01-21 17:53:41 +00:00
expect(fibonacci(15)).toBe(610);
});
2023-09-18 21:06:51 +00:00
test.skip('25th fibonacci number is 75025', () => {
2023-01-21 17:53:41 +00:00
expect(fibonacci(25)).toBe(75025);
});
test('0th fibonacci number is o', () => {
expect(fibonacci(0)).toBe(0);
});
2023-09-18 21:06:51 +00:00
test.skip('doesn\'t accept negatives', () => {
expect(fibonacci(-25)).toBe("OOPS");
2023-01-21 17:53:41 +00:00
});
2023-09-18 21:06:51 +00:00
test.skip('DOES accept strings', () => {
expect(fibonacci("0")).toBe(0);
2023-01-21 17:53:41 +00:00
});
2023-09-18 21:06:51 +00:00
test.skip('DOES accept strings', () => {
expect(fibonacci("1")).toBe(1);
2023-01-21 17:53:41 +00:00
});
2023-09-18 21:06:51 +00:00
test.skip('DOES accept strings', () => {
expect(fibonacci("2")).toBe(1);
});
test.skip('DOES accept strings', () => {
expect(fibonacci("8")).toBe(21);
2023-01-21 17:53:41 +00:00
});
2022-02-20 19:07:44 +00:00
});