diff options
| author | Martial Simon <msimon_fr@hotmail.com> | 2025-09-15 01:08:27 +0200 |
|---|---|---|
| committer | Martial Simon <msimon_fr@hotmail.com> | 2025-09-15 01:08:27 +0200 |
| commit | c9b6b9a5ca082fe7c1b6f58d7713f785a9eb6a5c (patch) | |
| tree | 3e4f42f93c7ae89a364e4d51fff6e5cec4e55fa9 /graphs/js/jestBasic/fibo.test.js | |
add: graphs et rushs
Diffstat (limited to 'graphs/js/jestBasic/fibo.test.js')
| -rw-r--r-- | graphs/js/jestBasic/fibo.test.js | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/graphs/js/jestBasic/fibo.test.js b/graphs/js/jestBasic/fibo.test.js new file mode 100644 index 0000000..6a97365 --- /dev/null +++ b/graphs/js/jestBasic/fibo.test.js @@ -0,0 +1,37 @@ +const { fibo } = require("./fibo"); + +describe("basic value", () => { + test("fibo of 0", () => { + expect(fibo(0)).toBe(0); + }); + test("fibo of 1", () => { + expect(fibo(1)).toBe(1); + }); + test("fibo of 2", () => { + expect(fibo(2)).toBe(1); + }); + test("fibo of 4", () => { + expect(fibo(4)).toBe(3); + }); + test("fibo of 19", () => { + expect(fibo(19)).toBe(4181); + }); +}); + +describe("errors", () => { + test("fibo of -1", () => { + expect(fibo(-1)).toBe(-1); + }); + test("fibo of null", () => { + expect(fibo(null)).toBe(-1); + }); + test("fibo of undefined", () => { + expect(fibo(undefined)).toBe(-1); + }); + test("fibo of a string", () => { + expect(fibo("uwu adrien")).toBe(-1); + }); + test("fibo of NaN", () => { + expect(fibo(NaN)).toBe(-1); + }); +}); |
