UNPKG

@santi100/binet-formula

Version:

Santi's Basic Binet Formula Library: What is F_n?

36 lines (29 loc) 1.15 kB
// Generated by CodiumAI describe('binetFormula_function', () => { const binetFormula = require('..'); // Tests that the function returns 0 when n is 0 it('test_happy_path_n_0', () => { expect(binetFormula(0)).toBe(0); }); // Tests that the function returns 1 when n is 1 it('test_happy_path_n_1', () => { expect(binetFormula(1)).toBe(1); }); // Tests that the function returns 1 when n is 2 it('test_happy_path_n_2', () => { expect(binetFormula(2)).toBe(1); }); // Tests that the function returns a really big number when n is Number.MAX_SAFE_INTEGER it('test_edge_case_n_max_safe_integer', () => { const result = binetFormula(Number.MAX_SAFE_INTEGER); expect(result).toBeGreaterThan(1e+100); }); // Tests that the function throws an error when n is negative it('test_edge_case_n_negative', () => { expect(() => binetFormula(-1)).toThrow(); }); // Tests that the function throws an error when n is not an integer it('test_edge_case_n_not_integer', () => { expect(() => binetFormula(1.5)).toThrow(); }); });