syntaxai/tdd.md · main · src / c14_forgejo.test.ts

c14_forgejo.test.ts 24 lines · 959 bytes raw
// Sibling test for c14_forgejo.ts (Layer 2, HTTP adapter to Forgejo).
// The functions here make real Forgejo API calls; integration coverage
// lives at the live /agents/register flow. This sibling pins the
// contract surface so a reviewer sees what the module exports.

import { describe, test, expect } from "bun:test";
import { FORGEJO_URL, isConfigured, adminApiHeaders } from "./c14_forgejo.ts";

describe("c14_forgejo — export shape", () => {
  test("FORGEJO_URL is a non-empty string", () => {
    expect(typeof FORGEJO_URL).toBe("string");
    expect(FORGEJO_URL.length).toBeGreaterThan(0);
  });
  test("isConfigured is a function returning boolean", () => {
    expect(typeof isConfigured).toBe("function");
    expect(typeof isConfigured()).toBe("boolean");
  });
  test("adminApiHeaders is a function", () => {
    expect(typeof adminApiHeaders).toBe("function");
    const h = adminApiHeaders();
    expect(typeof h).toBe("object");
  });
});