Co-authored-by: Claude Opus 4.7 <[email protected]> Co-authored-by: codex <[email protected]>
47 lines
1.2 KiB
TypeScript
47 lines
1.2 KiB
TypeScript
import { Schema } from "effect";
|
|
import { describe, expect, it } from "vitest";
|
|
|
|
import { ServerProvider } from "./server.ts";
|
|
|
|
const decodeServerProvider = Schema.decodeUnknownSync(ServerProvider);
|
|
|
|
describe("ServerProvider", () => {
|
|
it("defaults capability arrays when decoding provider snapshots", () => {
|
|
const parsed = decodeServerProvider({
|
|
instanceId: "codex",
|
|
driver: "codex",
|
|
enabled: true,
|
|
installed: true,
|
|
version: "1.0.0",
|
|
status: "ready",
|
|
auth: {
|
|
status: "authenticated",
|
|
},
|
|
checkedAt: "2026-04-10T00:00:00.000Z",
|
|
models: [],
|
|
});
|
|
|
|
expect(parsed.slashCommands).toEqual([]);
|
|
expect(parsed.skills).toEqual([]);
|
|
});
|
|
|
|
it("decodes continuation group metadata", () => {
|
|
const parsed = decodeServerProvider({
|
|
instanceId: "codex_personal",
|
|
driver: "codex",
|
|
continuation: { groupKey: "codex:home:/Users/julius/.codex" },
|
|
enabled: true,
|
|
installed: true,
|
|
version: "1.0.0",
|
|
status: "ready",
|
|
auth: {
|
|
status: "authenticated",
|
|
},
|
|
checkedAt: "2026-04-10T00:00:00.000Z",
|
|
models: [],
|
|
});
|
|
|
|
expect(parsed.continuation?.groupKey).toBe("codex:home:/Users/julius/.codex");
|
|
});
|
|
});
|