test(slashcommand): isolate command discovery mocks

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-27 13:24:50 +09:00
parent ecce65bb67
commit a2c3804b5f
4 changed files with 22 additions and 11 deletions
+4 -6
View File
@@ -1,10 +1,8 @@
import { dirname } from "path"
import {
resolveCommandsInText,
resolveFileReferencesInText,
} from "../../shared"
import { resolveCommandsInText } from "../../shared/command-executor/resolve-commands-in-text"
import { resolveFileReferencesInText } from "../../shared/file-reference-resolver"
import { discoverAllSkills, type LoadedSkill, type LazyContentLoader } from "../../features/opencode-skill-loader"
import { discoverCommandsSync } from "../../tools/slashcommand"
import * as commandDiscovery from "../../tools/slashcommand/command-discovery"
import type { CommandInfo as DiscoveredCommandInfo, CommandMetadata } from "../../tools/slashcommand/types"
import type { ParsedSlashCommand } from "./types"
@@ -47,7 +45,7 @@ export interface ExecutorOptions {
async function discoverAllCommands(options?: ExecutorOptions): Promise<CommandInfo[]> {
const discoveredCommands = discoverCommandsSync(options?.directory ?? process.cwd(), {
const discoveredCommands = commandDiscovery.discoverCommandsSync(options?.directory ?? process.cwd(), {
pluginsEnabled: options?.pluginsEnabled,
enabledPluginsOverride: options?.enabledPluginsOverride,
})