mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-17 09:41:36 +00:00
* chore(tooling): enforce current formatter and refresh checks * chore(tooling): keep release changelog formatter-owned * chore(tooling): retain compatible Node type surface * ci: enforce formatting for docs-only changes * ci: isolate docs formatter check * chore(tooling): apply updated lint and format rules * chore(tooling): satisfy updated switch lint * style(ui): apply Linux formatter layout * test(doctor): match quiet local audio contribution * test(doctor): assert quiet output only * test(doctor): follow restored information contract
21 lines
928 B
TypeScript
21 lines
928 B
TypeScript
// Voice Call tests cover voice mapping plugin behavior.
|
|
import { describe, expect, it } from "vitest";
|
|
import { DEFAULT_POLLY_VOICE, escapeXml, mapVoiceToPolly } from "./voice-mapping.js";
|
|
|
|
describe("voice mapping", () => {
|
|
it("escapes xml-special characters", () => {
|
|
expect(escapeXml(`5 < 6 & "quote" 'apostrophe' > 4`)).toBe(
|
|
"5 < 6 & "quote" 'apostrophe' > 4",
|
|
);
|
|
});
|
|
|
|
it("maps openai voices, passes through provider voices, and falls back to default", () => {
|
|
expect(mapVoiceToPolly("alloy")).toBe("Polly.Joanna");
|
|
expect(mapVoiceToPolly("ECHO")).toBe("Polly.Matthew");
|
|
expect(mapVoiceToPolly("Polly.Brian")).toBe("Polly.Brian");
|
|
expect(mapVoiceToPolly("Google.en-US-Standard-C")).toBe("Google.en-US-Standard-C");
|
|
expect(mapVoiceToPolly("unknown")).toBe(DEFAULT_POLLY_VOICE);
|
|
expect(mapVoiceToPolly(undefined)).toBe(DEFAULT_POLLY_VOICE);
|
|
});
|
|
});
|