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

推荐订阅源

腾讯CDC
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 叶小钗
人人都是产品经理
人人都是产品经理
博客园 - 聂微东
The Cloudflare Blog
爱范儿
爱范儿
阮一峰的网络日志
阮一峰的网络日志
WordPress大学
WordPress大学
小众软件
小众软件
博客园 - 三生石上(FineUI控件)
Last Week in AI
Last Week in AI
Jina AI
Jina AI
V
V2EX
罗磊的独立博客
V
Visual Studio Blog
A
About on SuperTechFans
IT之家
IT之家
P
Proofpoint News Feed
B
Blog
博客园 - Franky
Blog — PlanetScale
Blog — PlanetScale
Google DeepMind News
Google DeepMind News
Y
Y Combinator 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 deepinfra image assertions · openclaw/openc...
steipete · 2026-05-09 · via Recent Commits to openclaw:main

@@ -96,34 +96,56 @@ describe("deepinfra image generation provider", () => {

9696

} as never,

9797

});

989899-

expect(resolveProviderHttpRequestConfigMock).toHaveBeenCalledWith(

100-

expect.objectContaining({

101-

provider: "deepinfra",

102-

capability: "image",

103-

baseUrl: "https://api.deepinfra.com/v1/openai",

104-

}),

105-

);

106-

expect(postJsonRequestMock).toHaveBeenCalledWith(

107-

expect.objectContaining({

108-

url: "https://api.deepinfra.com/v1/openai/images/generations",

109-

timeoutMs: 12_345,

110-

body: {

111-

model: "black-forest-labs/FLUX-1-schnell",

112-

prompt: "red square",

113-

n: 2,

114-

size: "512x512",

115-

response_format: "b64_json",

99+

expect(resolveProviderHttpRequestConfigMock.mock.calls).toEqual([

100+

[

101+

{

102+

baseUrl: "https://api.deepinfra.com/v1/openai",

103+

defaultBaseUrl: "https://api.deepinfra.com/v1/openai",

104+

allowPrivateNetwork: false,

105+

request: undefined,

106+

defaultHeaders: {

107+

Authorization: "Bearer deepinfra-key",

108+

},

109+

provider: "deepinfra",

110+

capability: "image",

111+

transport: "http",

116112

},

117-

}),

118-

);

113+

],

114+

]);

115+

expect(postJsonRequestMock).toHaveBeenCalledOnce();

116+

const [jsonRequest] = postJsonRequestMock.mock.calls[0] ?? [];

117+

const jsonRequestHeaders = Reflect.get(jsonRequest ?? {}, "headers");

118+

expect(jsonRequestHeaders).toBeInstanceOf(Headers);

119+

expect(Object.fromEntries((jsonRequestHeaders as Headers).entries())).toEqual({

120+

authorization: "Bearer deepinfra-key",

121+

"content-type": "application/json",

122+

});

123+

expect(jsonRequest).toEqual({

124+

url: "https://api.deepinfra.com/v1/openai/images/generations",

125+

headers: jsonRequestHeaders,

126+

timeoutMs: 12_345,

127+

body: {

128+

model: "black-forest-labs/FLUX-1-schnell",

129+

prompt: "red square",

130+

n: 2,

131+

size: "512x512",

132+

response_format: "b64_json",

133+

},

134+

fetchFn: fetch,

135+

allowPrivateNetwork: false,

136+

dispatcherPolicy: undefined,

137+

});

119138

expect(result.images).toHaveLength(1);

120139

const [firstImage] = result.images;

121140

if (!firstImage) {

122141

throw new Error("Expected generated DeepInfra image");

123142

}

124-

expect(firstImage.mimeType).toBe("image/jpeg");

125-

expect(firstImage.fileName).toBe("image-1.jpg");

126-

expect(firstImage.revisedPrompt).toBe("red square");

143+

expect(firstImage).toEqual({

144+

buffer: jpegBytes,

145+

mimeType: "image/jpeg",

146+

fileName: "image-1.jpg",

147+

revisedPrompt: "red square",

148+

});

127149

expect(release).toHaveBeenCalledOnce();

128150

});

129151

@@ -152,16 +174,26 @@ describe("deepinfra image generation provider", () => {

152174

cfg: {} as never,

153175

});

154176155-

expect(postMultipartRequestMock).toHaveBeenCalledWith(

156-

expect.objectContaining({

157-

url: "https://api.deepinfra.com/v1/openai/images/edits",

158-

}),

159-

);

160-

const firstCall = postMultipartRequestMock.mock.calls[0];

161-

if (!firstCall) {

177+

expect(postMultipartRequestMock).toHaveBeenCalledOnce();

178+

const [multipartRequest] = postMultipartRequestMock.mock.calls[0] ?? [];

179+

if (!multipartRequest) {

162180

throw new Error("Expected DeepInfra multipart request");

163181

}

164-

const form = firstCall[0].body as FormData;

182+

const multipartHeaders = Reflect.get(multipartRequest, "headers");

183+

expect(multipartHeaders).toBeInstanceOf(Headers);

184+

expect(Object.fromEntries((multipartHeaders as Headers).entries())).toEqual({

185+

authorization: "Bearer deepinfra-key",

186+

});

187+

const form = Reflect.get(multipartRequest, "body") as FormData;

188+

expect(multipartRequest).toEqual({

189+

url: "https://api.deepinfra.com/v1/openai/images/edits",

190+

headers: multipartHeaders,

191+

body: form,

192+

timeoutMs: undefined,

193+

fetchFn: fetch,

194+

allowPrivateNetwork: false,

195+

dispatcherPolicy: undefined,

196+

});

165197

expect(form.get("model")).toBe("black-forest-labs/FLUX-1-schnell");

166198

expect(form.get("prompt")).toBe("make it neon");

167199

expect(form.get("response_format")).toBe("b64_json");