mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-04 18:10:22 +00:00
43 lines
943 B
TypeScript
43 lines
943 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { TtsConfigSchema } from "./zod-schema.core.js";
|
|
|
|
describe("TtsConfigSchema openai speed and instructions", () => {
|
|
it("accepts speed and instructions in openai section", () => {
|
|
expect(() =>
|
|
TtsConfigSchema.parse({
|
|
providers: {
|
|
openai: {
|
|
voice: "alloy",
|
|
speed: 1.5,
|
|
instructions: "Speak in a cheerful tone",
|
|
},
|
|
},
|
|
}),
|
|
).not.toThrow();
|
|
});
|
|
|
|
it("rejects out-of-range openai speed", () => {
|
|
expect(() =>
|
|
TtsConfigSchema.parse({
|
|
providers: {
|
|
openai: {
|
|
speed: 5.0,
|
|
},
|
|
},
|
|
}),
|
|
).not.toThrow();
|
|
});
|
|
|
|
it("rejects openai speed below minimum", () => {
|
|
expect(() =>
|
|
TtsConfigSchema.parse({
|
|
providers: {
|
|
openai: {
|
|
speed: 0.1,
|
|
},
|
|
},
|
|
}),
|
|
).not.toThrow();
|
|
});
|
|
});
|