Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

test: exercise real preset voice parser (#6748)

[._.]/ Adam Eivy8e055014dc98
diff --git a/server/routes/voice.test.js b/server/routes/voice.test.js
index 22a608eb00..a5a8e39aa0 100644
--- a/server/routes/voice.test.js
+++ b/server/routes/voice.test.js
@@ -29,16 +29,9 @@ vi.mock('../services/voice/tts.js', () => ({
listVoiceEngines: vi.fn(),
VALID_ENGINES: new Set(['kokoro', 'piper', 'qwen3-tts']),
}));
-vi.mock('../services/voice/profiles.js', () => ({
+vi.mock('../services/voice/profiles.js', async (importActual) => ({
+ ...(await importActual()),
listVoiceProfiles: vi.fn(),
- parsePresetVoiceId: (voiceId) => {
- const match = /^([a-z][a-z0-9-]*):([^:\s]+)$/i.exec(voiceId);
- if (!match) return null;
- const engine = match[1].toLowerCase() === 'qwen3' ? 'qwen3-tts' : match[1].toLowerCase();
- return ['kokoro', 'piper', 'qwen3-tts'].includes(engine)
- ? { engine, voice: match[2], voiceId: `${engine}:${match[2]}` }
- : null;
- },
promotePresetProfile: vi.fn(),
createVoiceDesignCandidate: vi.fn(),
createClonedVoiceCandidate: vi.fn(),