test(mcp): stabilize lsp builtin and doctor checks

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-05-18 13:21:02 +09:00
parent f7b60e360f
commit 69371b78b7
2 changed files with 113 additions and 2 deletions
+17 -2
View File
@@ -1,9 +1,16 @@
import { describe, expect, test } from "bun:test"
import { createBuiltinMcps } from "../index"
import { afterEach, describe, expect, mock, test } from "bun:test"
afterEach(() => {
mock.restore()
})
describe("createBuiltinMcps", () => {
test("should return all MCPs when disabled_mcps is empty", () => {
// given
mock.module("../lsp", () => ({
createLspMcpConfig: () => ({ type: "local", command: ["node", "dist/cli.js", "mcp"], enabled: true }),
}))
const { createBuiltinMcps } = require("../index") as typeof import("../index")
const disabledMcps: string[] = []
// when
@@ -19,6 +26,10 @@ describe("createBuiltinMcps", () => {
test("should filter out disabled MCPs", () => {
// given
mock.module("../lsp", () => ({
createLspMcpConfig: () => ({ type: "local", command: ["node", "dist/cli.js", "mcp"], enabled: true }),
}))
const { createBuiltinMcps } = require("../index") as typeof import("../index")
const disabledMcps = ["websearch"]
// when
@@ -33,6 +44,10 @@ describe("createBuiltinMcps", () => {
test("should return empty array when all MCPs are disabled", () => {
// given - disable all known MCPs
mock.module("../lsp", () => ({
createLspMcpConfig: () => ({ type: "local", command: ["node", "dist/cli.js", "mcp"], enabled: true }),
}))
const { createBuiltinMcps } = require("../index") as typeof import("../index")
const disabledMcps = ["websearch", "context7", "grep_app", "lsp"]
// when