惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
V2EX
小众软件
小众软件
GbyAI
GbyAI
B
Blog RSS Feed
月光博客
月光博客
A
About on SuperTechFans
Microsoft Security Blog
Microsoft Security Blog
Blog — PlanetScale
Blog — PlanetScale
U
Unit 42
云风的 BLOG
云风的 BLOG
P
Proofpoint News Feed
Recent Announcements
Recent Announcements
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Vercel News
Vercel News
F
Fortinet All Blogs
Apple Machine Learning Research
Apple Machine Learning Research
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
雷峰网
雷峰网
Google DeepMind News
Google DeepMind News
MongoDB | Blog
MongoDB | Blog
Engineering at Meta
Engineering at Meta
aimingoo的专栏
aimingoo的专栏
博客园_首页
G
Google Developers Blog

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
test: tighten speech provider assertions · openclaw/openc...
steipete · 2026-05-09 · via Recent Commits to openclaw:main

@@ -19,6 +19,14 @@ vi.mock("openclaw/plugin-sdk/provider-http", () => ({

1919

resolveProviderHttpRequestConfig: resolveProviderHttpRequestConfigMock,

2020

}));

212122+

function requireFirstMockArg(mock: ReturnType<typeof vi.fn>): Record<string, unknown> {

23+

const arg = mock.mock.calls[0]?.[0] as Record<string, unknown> | undefined;

24+

if (!arg) {

25+

throw new Error("missing first mock argument");

26+

}

27+

return arg;

28+

}

29+2230

describe("createOpenAiCompatibleSpeechProvider", () => {

2331

afterEach(() => {

2432

assertOkOrThrowHttpErrorMock.mockClear();

@@ -122,34 +130,29 @@ describe("createOpenAiCompatibleSpeechProvider", () => {

122130

timeoutMs: 1234,

123131

});

124132125-

expect(resolveProviderHttpRequestConfigMock).toHaveBeenCalledWith(

126-

expect.objectContaining({

127-

baseUrl: "https://example.test/v1",

128-

defaultBaseUrl: "https://example.test/v1",

129-

provider: "demo",

130-

capability: "audio",

131-

}),

132-

);

133-

expect(postJsonRequestMock).toHaveBeenCalledWith(

134-

expect.objectContaining({

135-

url: "https://example.test/v1/audio/speech",

136-

timeoutMs: 1234,

137-

body: {

138-

model: "override-tts",

139-

input: "hello",

140-

voice: "verse",

141-

response_format: "opus",

142-

speed: 1.1,

143-

provider: { order: ["openai"] },

144-

},

145-

}),

146-

);

147-

expect(result).toMatchObject({

148-

audioBuffer: Buffer.from([4, 5, 6]),

149-

outputFormat: "opus",

150-

fileExtension: ".opus",

151-

voiceCompatible: true,

133+

expect(resolveProviderHttpRequestConfigMock).toHaveBeenCalledOnce();

134+

const httpConfigRequest = requireFirstMockArg(resolveProviderHttpRequestConfigMock);

135+

expect(httpConfigRequest.baseUrl).toBe("https://example.test/v1");

136+

expect(httpConfigRequest.defaultBaseUrl).toBe("https://example.test/v1");

137+

expect(httpConfigRequest.provider).toBe("demo");

138+

expect(httpConfigRequest.capability).toBe("audio");

139+140+

expect(postJsonRequestMock).toHaveBeenCalledOnce();

141+

const postRequest = requireFirstMockArg(postJsonRequestMock);

142+

expect(postRequest.url).toBe("https://example.test/v1/audio/speech");

143+

expect(postRequest.timeoutMs).toBe(1234);

144+

expect(postRequest.body).toStrictEqual({

145+

model: "override-tts",

146+

input: "hello",

147+

voice: "verse",

148+

response_format: "opus",

149+

speed: 1.1,

150+

provider: { order: ["openai"] },

152151

});

152+

expect(result.audioBuffer).toStrictEqual(Buffer.from([4, 5, 6]));

153+

expect(result.outputFormat).toBe("opus");

154+

expect(result.fileExtension).toBe(".opus");

155+

expect(result.voiceCompatible).toBe(true);

153156

expect(release).toHaveBeenCalledOnce();

154157

});

155158

});