Files
Jatin PandeyandJatin Pandey cbdcea12a3 fix(setup): write Windsurf Cascade settings to its native config (#15132)
* fix(setup): write Windsurf Cascade settings to its native config

* fix(doctor): surface older Windsurf registrations

---------

Co-authored-by: Jatin Pandey <279688498+JayDev-27@users.noreply.github.com>
2026-11-29 16:52:34 -05:00

40 lines
1.4 KiB
TypeScript

import { join } from "node:path";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { supportedClients } from "../../../src/application/SupportedClients.js";
import { clearClientLocationEnvironment } from "../../fixtures/clientEnvironment.js";
beforeEach(clearClientLocationEnvironment);
afterEach(() => vi.unstubAllEnvs());
const home = "C:\\Users\\a";
const roaming = join(home, "AppData", "Roaming");
const configPath = (
name: string,
env: Parameters<typeof supportedClients>[2],
) =>
supportedClients(home, "win32", env).find((client) => client.name === name)
?.configPath;
describe("Windows AppData client paths", () => {
it.each([
["vscode", join(roaming, "Code", "User", "mcp.json")],
["trae", join(roaming, "Trae", "User", "mcp.json")],
["devin", join(roaming, "devin", "mcp_config.json")],
["windsurf", join(roaming, "devin", "mcp_config.json")],
])("treats an empty APPDATA as unset for %s", (name, expected) => {
expect(configPath(name, {})).toBe(expected);
expect(configPath(name, { APPDATA: "" })).toBe(expected);
});
it("uses the same roaming override for Windsurf and Devin", () => {
const env = { APPDATA: "D:/Profiles/Roaming" };
expect(configPath("windsurf", env)).toBe(
join(env.APPDATA, "devin", "mcp_config.json"),
);
expect(configPath("devin", env)).toBe(configPath("windsurf", env));
});
});