Files
2026-07-13 12:22:59 +08:00

18 lines
607 B
TypeScript

import { describe, expect, test } from "bun:test";
import * as path from "node:path";
import { RpcClient } from "@oh-my-pi/pi-coding-agent/modes/rpc/rpc-client";
describe("RpcClient.start", () => {
test("rejects when RPC process exits immediately", async () => {
using client = new RpcClient({
cliPath: path.join(import.meta.dir, "..", "src", "cli.ts"),
cwd: path.join(import.meta.dir, ".."),
provider: "__missing_provider__",
model: "claude-sonnet-4-5",
env: { PI_NO_TITLE: "1" },
});
await expect(client.start()).rejects.toThrow(/Unknown provider.*__missing_provider__/);
});
});