import { convertLength, toLengthUnit } from "../dist/utilitiesUnits"; test("to m", () => { expect(toLengthUnit("M")).toBe("m"); }); test("to in", () => { expect(toLengthUnit("Inch")).toBe("in"); }); test("ft to ft", () => { expect(convertLength(2, "ft", "ft")).toBe(2); }); test("cm to m", () => { expect(convertLength(2, "cm", "m")).toBe(0.02); }); test("dm to mm", () => { expect(convertLength(12.34, "dm", "mm")).toBe(1234); }); test("ft to mm", () => { expect(convertLength(12.34, "ft", "mm")).toBeCloseTo(3761.232, 3); }); test("cm to inch", () => { expect(convertLength(5, "cm", "in")).toBeCloseTo(1.96850394, 3); }); test("feet to inch", () => { expect(convertLength(1, "ft", "in")).toBe(12); }); test("inch to feet", () => { expect(convertLength(12, "in", "ft")).toBe(1); });