fix(setup): honor config roots and display terminal dry-run plans
Normalize empty XDG config homes once for configuration writers and registration readers. Render the resolved plan for terminal dry runs while preserving structured output. Cover registration placement and a real PTY dry run, including absence of configuration writes.
This commit is contained in:
@@ -37,6 +37,22 @@ const getClients = (home: string) =>
|
||||
);
|
||||
|
||||
describe("additional client configuration dialects", () => {
|
||||
it("treats an empty XDG config home as unset for OpenCode setup", async () => {
|
||||
const home = await createTestTempDirectory("rea-opencode-empty-xdg-");
|
||||
const client = supportedClients(home, "linux", {
|
||||
XDG_CONFIG_HOME: "",
|
||||
}).find(({ name }) => name === "opencode");
|
||||
const expectedPath = join(home, ".config/opencode/opencode.json");
|
||||
if (client === undefined) throw new Error("missing opencode client");
|
||||
|
||||
expect(client.configPath).toBe(expectedPath);
|
||||
expect(client.configPaths).toContain(expectedPath);
|
||||
expect(
|
||||
await configureClientConfiguration(client, {}, command),
|
||||
).toMatchObject({ status: "configured" });
|
||||
expect(await readFile(expectedPath, "utf8")).toContain('"mcp"');
|
||||
});
|
||||
|
||||
it.each([
|
||||
"opencode",
|
||||
"antigravity",
|
||||
|
||||
Reference in New Issue
Block a user