test(tools): update MCP, delegate-task, skill, and slashcommand tests

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-10 15:53:35 +09:00
parent ca9b5fde40
commit 37057f18b9
12 changed files with 312 additions and 112 deletions
@@ -2,7 +2,18 @@ import { afterEach, beforeEach, describe, expect, it } from "bun:test"
import { mkdtempSync, mkdirSync, rmSync, writeFileSync } from "node:fs"
import { tmpdir } from "node:os"
import { join } from "node:path"
import { discoverCommandsSync } from "./command-discovery"
function requireFresh<T>(modulePath: string): T {
const resolvedPath = require.resolve(modulePath)
if (require.cache?.[resolvedPath]) {
delete require.cache[resolvedPath]
}
return require(modulePath) as T
}
function discoverCommandsSync(...args: Parameters<typeof import("./command-discovery").discoverCommandsSync>): ReturnType<typeof import("./command-discovery").discoverCommandsSync> {
return requireFresh<typeof import("./command-discovery")>("./command-discovery").discoverCommandsSync(...args)
}
function writeCommand(path: string, description: string, body: string): void {
mkdirSync(join(path, ".."), { recursive: true })