Math.expm1.js 438 B

12345678910111213
  1. test("basic functionality", () => {
  2. expect(Math.expm1).toHaveLength(1);
  3. expect(Math.expm1(0)).toBe(0);
  4. expect(Math.expm1(-2)).toBeCloseTo(-0.864664);
  5. expect(Math.expm1(-1)).toBeCloseTo(-0.63212);
  6. expect(Math.expm1(1)).toBeCloseTo(1.718281);
  7. expect(Math.expm1(2)).toBeCloseTo(6.389056);
  8. expect(Math.expm1()).toBeNaN();
  9. expect(Math.expm1(undefined)).toBeNaN();
  10. expect(Math.expm1("foo")).toBeNaN();
  11. });