Created
March 17, 2020 10:47
-
-
Save manjotsidhu/ffedd150395f4acfd369aa21521150f2 to your computer and use it in GitHub Desktop.
TypeScript isFibonacci function unit testing using Jest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import isFibonacci from "./index" | |
var fibSeries: number[] = [0,1,1,2,3,5,8,13,21,34,55,89,144,233,377,610,987,1597,2584,4181] | |
test('Test fibonnaci series from 0 to 4181', () => { | |
for (var i = 0; i < fibSeries.length; i++) { | |
expect(isFibonacci(fibSeries[i])).toBe(true) | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Output: