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

推荐订阅源

云风的 BLOG
云风的 BLOG
V
Visual Studio Blog
人人都是产品经理
人人都是产品经理
The GitHub Blog
The GitHub Blog
月光博客
月光博客
T
Tailwind CSS Blog
小众软件
小众软件
Y
Y Combinator Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
P
Proofpoint News Feed
B
Blog RSS Feed
博客园 - 司徒正美
A
About on SuperTechFans
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 聂微东
Microsoft Security Blog
Microsoft Security Blog
Recent Announcements
Recent Announcements
博客园 - Franky
U
Unit 42
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Microsoft Azure Blog
Microsoft Azure Blog
T
The Blog of Author Tim Ferriss
GbyAI
GbyAI
Apple Machine Learning Research
Apple Machine Learning Research

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: dedupe openai tts mock calls · openclaw/openclaw@7a...
steipete · 2026-05-12 · via Recent Commits to openclaw:main

@@ -43,6 +43,22 @@ const officialEndpointValidationCases = [

4343

},

4444

];

454546+

function firstFetchCall(fetchMock: ReturnType<typeof vi.fn>): unknown[] {

47+

const call = fetchMock.mock.calls.at(0);

48+

if (!call) {

49+

throw new Error("expected fetch call");

50+

}

51+

return call;

52+

}

53+54+

function firstFetchInit(fetchMock: ReturnType<typeof vi.fn>): RequestInit {

55+

const init = firstFetchCall(fetchMock).at(1);

56+

if (!init || typeof init !== "object") {

57+

throw new Error("expected fetch init");

58+

}

59+

return init as RequestInit;

60+

}

61+4662

describe("openai tts", () => {

4763

const proxyReset = installDebugProxyTestResetHooks();

4864

const originalFetch = globalThis.fetch;

@@ -148,7 +164,8 @@ describe("openai tts", () => {

148164

timeoutMs: 5_000,

149165

});

150166151-

const [url, init] = fetchMock.mock.calls[0] ?? [];

167+

const url = firstFetchCall(fetchMock).at(0);

168+

const init = firstFetchInit(fetchMock);

152169

const headers = init?.headers as Record<string, string> | undefined;

153170

expect(url).toBe("https://api.openai.com/v1/audio/speech");

154171

expect(headers?.originator).toBe("openclaw");

@@ -174,7 +191,7 @@ describe("openai tts", () => {

174191

timeoutMs: 5_000,

175192

});

176193177-

const [, init] = fetchMock.mock.calls[0] ?? [];

194+

const init = firstFetchInit(fetchMock);

178195

if (typeof init?.body !== "string") {

179196

throw new Error("expected JSON request body");

180197

}

@@ -206,7 +223,7 @@ describe("openai tts", () => {

206223

timeoutMs: 5_000,

207224

});

208225209-

const [, init] = fetchMock.mock.calls[0] ?? [];

226+

const init = firstFetchInit(fetchMock);

210227

if (typeof init?.body !== "string") {

211228

throw new Error("expected JSON request body");

212229

}

@@ -241,7 +258,7 @@ describe("openai tts", () => {

241258

timeoutMs: 5_000,

242259

});

243260244-

const [, init] = fetchMock.mock.calls[0] ?? [];

261+

const init = firstFetchInit(fetchMock);

245262

if (typeof init?.body !== "string") {

246263

throw new Error("expected JSON request body");

247264

}