test: mock tts in system prompt wrappers

This commit is contained in:
Shakker
2026-05-09 17:48:32 +01:00
parent 7a14ae8c6f
commit 85ef6d248d
2 changed files with 10 additions and 2 deletions

View File

@@ -1,6 +1,10 @@
import { describe, expect, it } from "vitest";
import { describe, expect, it, vi } from "vitest";
import { buildCliAgentSystemPrompt } from "./helpers.js";
vi.mock("../../tts/tts.js", () => ({
buildTtsSystemPromptHint: vi.fn(() => undefined),
}));
describe("buildCliAgentSystemPrompt", () => {
it("uses config-backed sub-agent delegation mode", () => {
const prompt = buildCliAgentSystemPrompt({

View File

@@ -1,5 +1,5 @@
import type { AgentSession } from "@mariozechner/pi-coding-agent";
import { afterEach, describe, expect, it } from "vitest";
import { afterEach, describe, expect, it, vi } from "vitest";
import { clearMemoryPluginState, registerMemoryPromptSection } from "../../plugins/memory-state.js";
import {
applySystemPromptOverrideToSession,
@@ -7,6 +7,10 @@ import {
createSystemPromptOverride,
} from "./system-prompt.js";
vi.mock("../../tts/tts.js", () => ({
buildTtsSystemPromptHint: vi.fn(() => undefined),
}));
type MutableSession = {
_baseSystemPrompt?: string;
_rebuildSystemPrompt?: (toolNames: string[]) => string;