speech-core: fix TTS regression test typing

This commit is contained in:
liuhuaize
2026-04-10 13:31:48 +08:00
committed by Peter Steinberger
parent b3d7fd166a
commit 271d3b3bdb

View File

@@ -5,13 +5,14 @@ import type { ReplyPayload } from "openclaw/plugin-sdk/reply-runtime";
import type {
SpeechProviderPlugin,
SpeechSynthesisRequest,
SpeechSynthesisResult,
} from "openclaw/plugin-sdk/speech-core";
import { afterEach, describe, expect, it, vi } from "vitest";
type MockSpeechSynthesisResult = Awaited<ReturnType<SpeechProviderPlugin["synthesize"]>>;
const synthesizeMock = vi.hoisted(() =>
vi.fn(
async (request: SpeechSynthesisRequest): Promise<SpeechSynthesisResult> => ({
async (request: SpeechSynthesisRequest): Promise<MockSpeechSynthesisResult> => ({
audioBuffer: Buffer.from("voice"),
fileExtension: ".ogg",
outputFormat: "ogg",