import { describe, expectTypeOf, it } from "vitest"; import type { HugoCommand, HugoOptionsFor } from "../../src/generated/types"; describe("Type Safety", () => { it("should have correct command types", () => { // Check that specific commands are valid HugoCommand values expectTypeOf<"build">().toExtend(); expectTypeOf<"server">().toExtend(); expectTypeOf<"new project">().toExtend(); expectTypeOf<"new theme">().toExtend(); expectTypeOf<"new content">().toExtend(); }); it("should map commands to correct option types", () => { type BuildOpts = HugoOptionsFor<"build">; type ServerOpts = HugoOptionsFor<"server">; type NewProjectOpts = HugoOptionsFor<"new project">; type NewThemeOpts = HugoOptionsFor<"new theme">; // Build options should have minify expectTypeOf().toHaveProperty("minify"); // Server options should have port expectTypeOf().toHaveProperty("port"); // New project options should have format expectTypeOf().toHaveProperty("format"); // New theme options should have format expectTypeOf().toHaveProperty("format"); }); it("should inherit global options", () => { type BuildOpts = HugoOptionsFor<"build">; // All commands should have global options expectTypeOf().toHaveProperty("source"); expectTypeOf().toHaveProperty("destination"); expectTypeOf().toHaveProperty("environment"); }); });