mirror of
https://github.com/moltbot/moltbot.git
synced 2026-05-13 15:47:28 +00:00
test: tighten deepgram audio request assertion
This commit is contained in:
@@ -55,14 +55,17 @@ describe("transcribeDeepgramAudio", () => {
|
||||
expect(seenUrl).toBe(
|
||||
"https://api.example.com/v1/listen?model=nova-3&language=en&punctuate=false&smart_format=true",
|
||||
);
|
||||
expect(seenInit?.method).toBe("POST");
|
||||
expect(seenInit?.signal).toBeInstanceOf(AbortSignal);
|
||||
if (!seenInit) {
|
||||
throw new Error("Expected Deepgram fetch request init");
|
||||
}
|
||||
expect(seenInit.method).toBe("POST");
|
||||
expect(seenInit.signal).toBeInstanceOf(AbortSignal);
|
||||
|
||||
const headers = new Headers(seenInit?.headers);
|
||||
const headers = new Headers(seenInit.headers);
|
||||
expect(headers.get("authorization")).toBe("Token test-key");
|
||||
expect(headers.get("x-custom")).toBe("1");
|
||||
expect(headers.get("content-type")).toBe("audio/wav");
|
||||
expect(seenInit?.body).toBeInstanceOf(Uint8Array);
|
||||
expect(seenInit.body).toBeInstanceOf(Uint8Array);
|
||||
});
|
||||
|
||||
it("throws when the provider response omits transcript", async () => {
|
||||
|
||||
Reference in New Issue
Block a user