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

32 lines
897 B
JavaScript
Raw Normal View History

2023-02-01 23:53:54 +00:00
const fibonacci = require('./fibonacci-solution');
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-02-01 23:53:54 +00:00
test.skip('6th fibonacci number is 8', () => {
2023-01-21 17:53:41 +00:00
expect(fibonacci(6)).toBe(8);
});
2023-02-01 23:53:54 +00:00
test.skip('10th fibonacci number is 55', () => {
2023-01-21 17:53:41 +00:00
expect(fibonacci(10)).toBe(55);
});
2023-02-01 23:53:54 +00:00
test.skip('15th fibonacci number is 610', () => {
2023-01-21 17:53:41 +00:00
expect(fibonacci(15)).toBe(610);
});
2023-02-01 23:53:54 +00:00
test.skip('25th fibonacci number is 75025', () => {
2023-01-21 17:53:41 +00:00
expect(fibonacci(25)).toBe(75025);
});
test.skip("doesn't accept negatives", () => {
2023-02-01 23:53:54 +00:00
expect(fibonacci(-25)).toBe('OOPS');
2023-01-21 17:53:41 +00:00
});
2023-02-01 23:53:54 +00:00
test.skip('DOES accept strings', () => {
expect(fibonacci('1')).toBe(1);
2023-01-21 17:53:41 +00:00
});
2023-02-01 23:53:54 +00:00
test.skip('DOES accept strings', () => {
expect(fibonacci('2')).toBe(1);
2023-01-21 17:53:41 +00:00
});
2023-02-01 23:53:54 +00:00
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
});