fix: honor audio_as_voice streaming + parse tests (#490) (thanks @jarvis-medmatic)

This commit is contained in:
Peter Steinberger
2026-01-10 01:50:33 +01:00
parent 5fedfd8d15
commit c56b2f4bc1
7 changed files with 32 additions and 4 deletions

19
src/media/parse.test.ts Normal file
View File

@@ -0,0 +1,19 @@
import { describe, expect, it } from "vitest";
import { splitMediaFromOutput } from "./parse.js";
describe("splitMediaFromOutput", () => {
it("detects audio_as_voice tag and strips it", () => {
const result = splitMediaFromOutput("Hello [[audio_as_voice]] world");
expect(result.audioAsVoice).toBe(true);
expect(result.text).toBe("Hello world");
});
it("keeps audio_as_voice detection stable across calls", () => {
const input = "Hello [[audio_as_voice]]";
const first = splitMediaFromOutput(input);
const second = splitMediaFromOutput(input);
expect(first.audioAsVoice).toBe(true);
expect(second.audioAsVoice).toBe(true);
});
});