(func: (n: number) => number)
| 5 | } from '../fibonacci' |
| 6 | |
| 7 | const test = (func: (n: number) => number) => |
| 8 | it.each([ |
| 9 | [0, 0], |
| 10 | [1, 1], |
| 11 | [2, 1], |
| 12 | [5, 5], |
| 13 | [10, 55], |
| 14 | [15, 610] |
| 15 | ])('fib(%i) = %i', (n, expected) => expect(func(n)).toBe(expected)) |
| 16 | describe('Fibonacci iterative', () => test(nthFibonacci)) |
| 17 | describe('Fibonacci recursive', () => test(nthFibonacciRecursively)) |
| 18 | describe('Fibonacci Using formula', () => test(nthFibonacciUsingFormula)) |
no outgoing calls
no test coverage detected