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

推荐订阅源

Blog — PlanetScale
Blog — PlanetScale
博客园 - 司徒正美
Vercel News
Vercel News
F
Fortinet All Blogs
月光博客
月光博客
G
Google Developers Blog
博客园 - Franky
GbyAI
GbyAI
The Cloudflare Blog
I
InfoQ
雷峰网
雷峰网
WordPress大学
WordPress大学
罗磊的独立博客
大猫的无限游戏
大猫的无限游戏
T
The Blog of Author Tim Ferriss
Apple Machine Learning Research
Apple Machine Learning Research
博客园 - 聂微东
小众软件
小众软件
腾讯CDC
B
Blog
量子位
V
V2EX
S
SegmentFault 最新的问题
Google DeepMind News
Google DeepMind News

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 diffs tool assertions · openclaw/openclaw@d...
steipete · 2026-05-11 · via Recent Commits to openclaw:main

@@ -38,8 +38,8 @@ describe("diffs tool", () => {

38383939

const text = readTextContent(result, 0);

4040

expect(text).toContain("http://127.0.0.1:18789/plugins/diffs/view/");

41-

expect(readDetails(result).viewerUrl).toEqual(

42-

expect.stringContaining("http://127.0.0.1:18789/plugins/diffs/view/"),

41+

expect(String(readDetails(result).viewerUrl)).toContain(

42+

"http://127.0.0.1:18789/plugins/diffs/view/",

4343

);

4444

});

4545

@@ -63,8 +63,8 @@ describe("diffs tool", () => {

6363

expect(readTextContent(result, 0)).toContain(

6464

"https://example.com/openclaw/plugins/diffs/view/",

6565

);

66-

expect((result?.details as Record<string, unknown>).viewerUrl).toEqual(

67-

expect.stringContaining("https://example.com/openclaw/plugins/diffs/view/"),

66+

expect(String((result?.details as Record<string, unknown>).viewerUrl)).toContain(

67+

"https://example.com/openclaw/plugins/diffs/view/",

6868

);

6969

});

7070

@@ -89,8 +89,8 @@ describe("diffs tool", () => {

8989

expect(readTextContent(result, 0)).toContain(

9090

"https://preview.example.com/review/plugins/diffs/view/",

9191

);

92-

expect((result?.details as Record<string, unknown>).viewerUrl).toEqual(

93-

expect.stringContaining("https://preview.example.com/review/plugins/diffs/view/"),

92+

expect(String((result?.details as Record<string, unknown>).viewerUrl)).toContain(

93+

"https://preview.example.com/review/plugins/diffs/view/",

9494

);

9595

});

9696

@@ -112,12 +112,10 @@ describe("diffs tool", () => {

112112

expect(html).toContain("../../assets/viewer.js");

113113

},

114114

assertImage: (image) => {

115-

expect(image).toMatchObject({

116-

format: "png",

117-

qualityPreset: "standard",

118-

scale: 2,

119-

maxWidth: 960,

120-

});

115+

expect(image.format).toBe("png");

116+

expect(image.qualityPreset).toBe("standard");

117+

expect(image.scale).toBe(2);

118+

expect(image.maxWidth).toBe(960);

121119

},

122120

});

123121

@@ -215,9 +213,7 @@ describe("diffs tool", () => {

215213216214

vi.setSystemTime(new Date(now.getTime() + 2_000));

217215

await store.cleanupExpired();

218-

await expect(fs.stat(filePath)).rejects.toMatchObject({

219-

code: "ENOENT",

220-

});

216+

await expectFsEnoent(fs.stat(filePath));

221217

} finally {

222218

vi.useRealTimers();

223219

}

@@ -244,9 +240,7 @@ describe("diffs tool", () => {

244240245241

vi.setSystemTime(new Date(now.getTime() + 61_000));

246242

await store.cleanupExpired();

247-

await expect(fs.stat(filePath)).rejects.toMatchObject({

248-

code: "ENOENT",

249-

});

243+

await expectFsEnoent(fs.stat(filePath));

250244

} finally {

251245

vi.useRealTimers();

252246

}

@@ -255,11 +249,9 @@ describe("diffs tool", () => {

255249

it("accepts image* tool options for backward compatibility", async () => {

256250

const screenshotter = createPngScreenshotter({

257251

assertImage: (image) => {

258-

expect(image).toMatchObject({

259-

qualityPreset: "hq",

260-

scale: 2.4,

261-

maxWidth: 1100,

262-

});

252+

expect(image.qualityPreset).toBe("hq");

253+

expect(image.scale).toBe(2.4);

254+

expect(image.maxWidth).toBe(1100);

263255

},

264256

});

265257

@@ -439,12 +431,10 @@ describe("diffs tool", () => {

439431

expect(html).toContain("../../assets/viewer.js");

440432

},

441433

assertImage: (image) => {

442-

expect(image).toMatchObject({

443-

format: "png",

444-

qualityPreset: "print",

445-

scale: 2.75,

446-

maxWidth: 1320,

447-

});

434+

expect(image.format).toBe("png");

435+

expect(image.qualityPreset).toBe("print");

436+

expect(image.scale).toBe(2.75);

437+

expect(image.maxWidth).toBe(1320);

448438

},

449439

});

450440

const tool = createToolWithScreenshotter(store, screenshotter, {

@@ -639,6 +629,16 @@ function requireString(value: unknown, label: string): string {

639629

return value;

640630

}

641631632+

async function expectFsEnoent(promise: Promise<unknown>): Promise<void> {

633+

try {

634+

await promise;

635+

} catch (error) {

636+

expect((error as { code?: unknown }).code).toBe("ENOENT");

637+

return;

638+

}

639+

throw new Error("expected ENOENT");

640+

}

641+642642

function readTextContent(result: unknown, index: number): string {

643643

const content = (result as { content?: Array<{ type?: string; text?: string }> } | undefined)

644644

?.content;