Skip to content

Commit 3288856

Browse files
test(server): check speech registry IDs against the bundled catalog
1 parent 62ebd0d commit 3288856

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎apps/server/src/speech/model.test.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { expect, it } from "vite-plus/test";
22

3+
import catalog from "./catalog.json" with { type: "json" };
34
import {
45
DEFAULT_SPEECH_MODEL_ID,
56
effectiveSpeechLanguage,
@@ -8,8 +9,9 @@ import {
89
} from "./model.ts";
910

1011
it("offers the full eligible catalog through one canonical registry", () => {
11-
expect(SPEECH_MODELS).toHaveLength(71);
12-
expect(new Set(SPEECH_MODELS.map((model) => model.id)).size).toBe(SPEECH_MODELS.length);
12+
const ids = new Set(SPEECH_MODELS.map((model) => model.id));
13+
expect(ids).toEqual(new Set(catalog.models.map((model) => model.id)));
14+
expect(ids.size).toBe(SPEECH_MODELS.length);
1315
expect(new Set(SPEECH_MODELS.map((model) => model.filename)).size).toBe(SPEECH_MODELS.length);
1416
expect(getSpeechModel(DEFAULT_SPEECH_MODEL_ID)).toBeDefined();
1517
for (const id of ["parakeet-ultra", "orukeet", "granite-speech-5.0-470m-turboctc"]) {

0 commit comments

Comments
 (0)