























@@ -3,8 +3,8 @@ import { TtsConfigSchema } from "./zod-schema.core.js";
3344describe("TtsConfigSchema openai speed and instructions", () => {
55it("accepts speed and instructions in openai section", () => {
6-expect(() =>
7-TtsConfigSchema.parse({
6+expect(
7+TtsConfigSchema.safeParse({
88providers: {
99openai: {
1010voice: "alloy",
@@ -13,12 +13,12 @@ describe("TtsConfigSchema openai speed and instructions", () => {
1313},
1414},
1515}),
16-).not.toThrow();
16+).toMatchObject({ success: true });
1717});
18181919it("accepts openai extraBody objects for compatible TTS endpoints", () => {
20-expect(() =>
21-TtsConfigSchema.parse({
20+expect(
21+TtsConfigSchema.safeParse({
2222providers: {
2323openai: {
2424baseUrl: "http://localhost:8880/v1",
@@ -31,36 +31,36 @@ describe("TtsConfigSchema openai speed and instructions", () => {
3131},
3232},
3333}),
34-).not.toThrow();
34+).toMatchObject({ success: true });
3535});
363637-it("rejects out-of-range openai speed", () => {
38-expect(() =>
39-TtsConfigSchema.parse({
37+it("accepts out-of-range openai speed for provider passthrough", () => {
38+expect(
39+TtsConfigSchema.safeParse({
4040providers: {
4141openai: {
4242speed: 5.0,
4343},
4444},
4545}),
46-).not.toThrow();
46+).toMatchObject({ success: true });
4747});
484849-it("rejects openai speed below minimum", () => {
50-expect(() =>
51-TtsConfigSchema.parse({
49+it("accepts openai speed below minimum for provider passthrough", () => {
50+expect(
51+TtsConfigSchema.safeParse({
5252providers: {
5353openai: {
5454speed: 0.1,
5555},
5656},
5757}),
58-).not.toThrow();
58+).toMatchObject({ success: true });
5959});
60606161it("accepts provider-specific persona bindings and structured prompt fields", () => {
62-expect(() =>
63-TtsConfigSchema.parse({
62+expect(
63+TtsConfigSchema.safeParse({
6464persona: "alfred",
6565personas: {
6666alfred: {
@@ -92,7 +92,7 @@ describe("TtsConfigSchema openai speed and instructions", () => {
9292},
9393},
9494}),
95-).not.toThrow();
95+).toMatchObject({ success: true });
9696});
97979898it("rejects persona rewrite config until runtime behavior exists", () => {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。