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
@@ -1,5 +1,12 @@
const { describe, test, expect, beforeEach, afterEach, mock, spyOn } = require("bun:test")
function clearRequireCache(modulePath: string): void {
const resolvedPath = require.resolve(modulePath)
if (require.cache?.[resolvedPath]) {
delete require.cache[resolvedPath]
}
}
describe("executeSyncTask - cleanup on error paths", () => {
let removeTaskCalls: string[] = []
let addTaskCalls: any[] = []
@@ -23,6 +30,8 @@ describe("executeSyncTask - cleanup on error paths", () => {
deleteCalls = []
addCalls = []
clearRequireCache("./sync-task")
//#given - initialize real task toast manager (avoid global module mocks)
const { initTaskToastManager, _resetTaskToastManagerForTesting } = require("../../features/task-toast-manager/manager")
_resetTaskToastManagerForTesting()