test(mcp): add regression coverage for transcript and disable overrides

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
YeonGyu-Kim
2026-04-04 01:12:35 +09:00
parent 53eeac3f31
commit 58e85960a1
2 changed files with 113 additions and 0 deletions
@@ -138,6 +138,41 @@ describe("getSystemMcpServerNames", () => {
}
})
it("removes a server name when a higher-precedence config disables it", async () => {
// given
writeFileSync(join(TEST_HOME, ".claude.json"), JSON.stringify({
mcpServers: {
playwright: {
command: "npx",
args: ["@playwright/mcp@latest"],
},
},
}))
writeFileSync(join(TEST_DIR, ".mcp.json"), JSON.stringify({
mcpServers: {
playwright: {
command: "npx",
args: ["@playwright/mcp@latest"],
disabled: true,
},
},
}))
const originalCwd = process.cwd()
process.chdir(TEST_DIR)
try {
// when
const { getSystemMcpServerNames } = await import("./loader")
const names = getSystemMcpServerNames()
// then
expect(names.has("playwright")).toBe(false)
} finally {
process.chdir(originalCwd)
}
})
it("merges server names from multiple .mcp.json files", async () => {
// given
mkdirSync(join(TEST_DIR, ".claude"), { recursive: true })