🧹 [code health] Remove "as any" usage in types test

Removed the use of `as any` for mocking the `Unit` interface in `src/engine/types.test.ts` by explicitly typing the object as `Unit`.

Co-authored-by: Horizontal42 <75383519+Horizontal42@users.noreply.github.com>
This commit is contained in:
google-labs-jules[bot] 2026-09-10 08:40:09 +00:00
parent 37cfd2144b
commit 136aca1201

View file

@ -1,5 +1,5 @@
import { describe, it, expect } from "vitest";
import { qty, pct, Decimal } from "./types";
import { qty, pct, Decimal, Unit } from "./types";
describe("types", () => {
describe("qty", () => {
@ -13,7 +13,7 @@ describe("types", () => {
});
it("creates a quantity with all arguments provided", () => {
const mockUnit = { id: "meter", dimension: "length", ratio: new Decimal(1), format: "m" } as any;
const mockUnit: Unit = { id: "meter", dimension: "length", ratio: new Decimal(1), format: "m" };
const result = qty("3.14", mockUnit, "hex");
expect(result.kind).toBe("quantity");
expect(result.value).toBeInstanceOf(Decimal);