Skip to content

Commit 706a18b

Browse files
Jeniterclaude
andauthored
test: add unit tests for ProsodyOptions (edge-tts) (#6849)
Adds a small, focused, additive unit-test file (test/prosody-options.test.ts). No existing files are modified or removed. yarn test:ci passes locally. Co-authored-by: ytj-zuel <15623621570> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 79aeddd commit 706a18b

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

test/prosody-options.test.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { ProsodyOptions } from "../app/utils/ms_edge_tts";
2+
3+
describe("ProsodyOptions", () => {
4+
test("has sensible SSML defaults", () => {
5+
const options = new ProsodyOptions();
6+
expect(options.pitch).toBe("+0Hz");
7+
expect(options.rate).toBe(1.0);
8+
expect(options.volume).toBe(100.0);
9+
});
10+
11+
test("allows overriding pitch, rate and volume", () => {
12+
const options = new ProsodyOptions();
13+
options.pitch = "+2st";
14+
options.rate = "+50%";
15+
options.volume = 50;
16+
expect(options.pitch).toBe("+2st");
17+
expect(options.rate).toBe("+50%");
18+
expect(options.volume).toBe(50);
19+
});
20+
21+
test("keeps two instances independent", () => {
22+
const a = new ProsodyOptions();
23+
const b = new ProsodyOptions();
24+
a.rate = 2.0;
25+
expect(b.rate).toBe(1.0);
26+
});
27+
});

0 commit comments

Comments
 (0)