test: mock tts in system prompt wrappers · openclaw/openclaw@85ef6d2
shakkernerd
·
2026-05-10
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | | -import { describe, expect, it } from "vitest"; |
| 1 | +import { describe, expect, it, vi } from "vitest"; |
2 | 2 | import { buildCliAgentSystemPrompt } from "./helpers.js"; |
3 | 3 | |
| 4 | +vi.mock("../../tts/tts.js", () => ({ |
| 5 | +buildTtsSystemPromptHint: vi.fn(() => undefined), |
| 6 | +})); |
| 7 | + |
4 | 8 | describe("buildCliAgentSystemPrompt", () => { |
5 | 9 | it("uses config-backed sub-agent delegation mode", () => { |
6 | 10 | const prompt = buildCliAgentSystemPrompt({ |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import type { AgentSession } from "@mariozechner/pi-coding-agent"; |
2 | | -import { afterEach, describe, expect, it } from "vitest"; |
| 2 | +import { afterEach, describe, expect, it, vi } from "vitest"; |
3 | 3 | import { clearMemoryPluginState, registerMemoryPromptSection } from "../../plugins/memory-state.js"; |
4 | 4 | import { |
5 | 5 | applySystemPromptOverrideToSession, |
6 | 6 | buildEmbeddedSystemPrompt, |
7 | 7 | createSystemPromptOverride, |
8 | 8 | } from "./system-prompt.js"; |
9 | 9 | |
| 10 | +vi.mock("../../tts/tts.js", () => ({ |
| 11 | +buildTtsSystemPromptHint: vi.fn(() => undefined), |
| 12 | +})); |
| 13 | + |
10 | 14 | type MutableSession = { |
11 | 15 | _baseSystemPrompt?: string; |
12 | 16 | _rebuildSystemPrompt?: (toolNames: string[]) => string; |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。