Math.trunc.js 358 B

123456789101112
  1. test("basic functionality", () => {
  2. expect(Math.trunc).toHaveLength(1);
  3. expect(Math.trunc(13.37)).toBe(13);
  4. expect(Math.trunc(42.84)).toBe(42);
  5. expect(Math.trunc(0.123)).toBe(0);
  6. expect(Math.trunc(-0.123)).toBe(-0);
  7. expect(Math.trunc(NaN)).toBeNaN();
  8. expect(Math.trunc("foo")).toBeNaN();
  9. expect(Math.trunc()).toBeNaN();
  10. });