import { describe, it, expect, vi } from "vitest";
import { runAppProgressSchema } from "./schema";

describe("runAppProgressSchema", () => {
  it("outputs valid JSON Schema", () => {
    const spy = vi.spyOn(console, "log").mockImplementation(() => undefined);

    const result = runAppProgressSchema();

    expect(result.exitCode).toBe(0);
    expect(spy).toHaveBeenCalledOnce();

    const schema = JSON.parse(String(spy.mock.calls[0]?.[0])) as Record<string, unknown>;
    expect(schema).toHaveProperty("anyOf");

    spy.mockRestore();
  });
});
