You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
444 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

import { describe, expect, it } from "vitest";
import { cmToIn, kgToLb } from "@/modules/quote/unit-converter";
describe("unit-converter", () => {
it("227kg → 500.45lbROUND_HALF_UPJS 浮点 227×2.20462", () => {
expect(kgToLb(227)).toBe(500.45);
});
it("122cm → 48.03in", () => {
expect(cmToIn(122)).toBe(48.03);
});
it("500lb 不变", () => {
expect(kgToLb(500 / 2.20462)).toBeCloseTo(500, 0);
});
});