odin-javascript-exercises/fibonacci/fibonacci.spec.js

26 lines
585 B
JavaScript
Raw Normal View History

2017-12-15 09:01:24 -08:00
const fibonacci = require("./fibonacci");
2017-08-25 12:29:48 -07:00
2017-12-15 09:01:24 -08:00
describe("fibonacci", () => {
it("works", () => {
2017-08-25 12:29:48 -07:00
expect(fibonacci(4)).toEqual(3);
});
2017-12-15 09:01:24 -08:00
it("works", () => {
2017-08-25 12:29:48 -07:00
expect(fibonacci(6)).toEqual(8);
});
2017-12-15 09:01:24 -08:00
it("works", () => {
2017-08-25 12:29:48 -07:00
expect(fibonacci(10)).toEqual(55);
});
2017-12-15 09:01:24 -08:00
it("works", () => {
2017-08-25 12:29:48 -07:00
expect(fibonacci(15)).toEqual(610);
});
2017-12-15 09:01:24 -08:00
it("works", () => {
2017-08-25 12:29:48 -07:00
expect(fibonacci(25)).toEqual(75025);
});
2017-12-15 09:01:24 -08:00
it("doesn't accept negatives", () => {
2017-08-25 12:29:48 -07:00
expect(fibonacci(-25)).toEqual("OOPS");
});
2017-12-15 09:01:24 -08:00
it("DOES accept strings", () => {
2017-08-25 12:29:48 -07:00
expect(fibonacci("8")).toEqual(21);
});
});