Skip to content
TypeScript
1009 B
Raw Blame
/**
 * W7 — install 하드닝. 상태 점검/베스트에포트가 throw 없이 동작.
 */
import { describe, expect, it, vi } from "vitest";
import { installBinary, runInstall, runInstallCheck } from "../src/install";

describe("install hardening", () => {
  it("runInstallCheck prints status without throwing", () => {
    const log = vi.spyOn(console, "log").mockImplementation(() => {});
    expect(() => runInstallCheck()).not.toThrow();
    expect(log).toHaveBeenCalled();
    log.mockRestore();
  });

  it("installBinary reports presence (claude available, fake missing)", () => {
    const log = vi.spyOn(console, "log").mockImplementation(() => {});
    expect(typeof installBinary("cc")).toBe("boolean");
    log.mockRestore();
  });

  it("runInstall on unknown component lists valid options (no throw)", async () => {
    const log = vi.spyOn(console, "log").mockImplementation(() => {});
    await expect(runInstall("nonsense-xyz")).resolves.toBeUndefined();
    log.mockRestore();
  });
});