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

推荐订阅源

奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Blog — PlanetScale
Blog — PlanetScale
小众软件
小众软件
F
Fortinet All Blogs
博客园 - 叶小钗
博客园_首页
D
DataBreaches.Net
Apple Machine Learning Research
Apple Machine Learning Research
U
Unit 42
爱范儿
爱范儿
aimingoo的专栏
aimingoo的专栏
博客园 - Franky
Martin Fowler
Martin Fowler
酷 壳 – CoolShell
酷 壳 – CoolShell
The Cloudflare Blog
A
About on SuperTechFans
Google DeepMind News
Google DeepMind News
Microsoft Security Blog
Microsoft Security Blog
IT之家
IT之家
M
MIT News - Artificial intelligence
有赞技术团队
有赞技术团队
博客园 - 【当耐特】
S
SegmentFault 最新的问题
Hugging Face - Blog
Hugging Face - 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 mattermost probe assertions · openclaw/open...
shakkernerd · 2026-05-11 · via Recent Commits to openclaw:main

@@ -43,22 +43,19 @@ describe("probeMattermost", () => {

43434444

const result = await probeMattermost("https://mm.example.com/api/v4/", "bot-token");

454546-

expect(mockFetchGuard).toHaveBeenCalledWith({

47-

url: "https://mm.example.com/api/v4/users/me",

48-

init: expect.objectContaining({

49-

headers: { Authorization: "Bearer bot-token" },

50-

}),

51-

auditContext: "mattermost-probe",

52-

policy: undefined,

46+

const [fetchCall] = mockFetchGuard.mock.calls[0] ?? [];

47+

expect(fetchCall?.url).toBe("https://mm.example.com/api/v4/users/me");

48+

expect(fetchCall?.init?.headers).toStrictEqual({ Authorization: "Bearer bot-token" });

49+

expect(fetchCall?.init?.signal).toBeInstanceOf(AbortSignal);

50+

expect(fetchCall?.auditContext).toBe("mattermost-probe");

51+

expect(fetchCall?.policy).toBeUndefined();

52+

const { elapsedMs, ...stableResult } = result;

53+

expect(stableResult).toStrictEqual({

54+

ok: true,

55+

status: 200,

56+

bot: { id: "bot-1", username: "clawbot" },

5357

});

54-

expect(result).toEqual(

55-

expect.objectContaining({

56-

ok: true,

57-

status: 200,

58-

bot: { id: "bot-1", username: "clawbot" },

59-

}),

60-

);

61-

expect(result.elapsedMs).toBeGreaterThanOrEqual(0);

58+

expect(elapsedMs).toBeGreaterThanOrEqual(0);

6259

expect(mockRelease).toHaveBeenCalledTimes(1);

6360

});

6461

@@ -73,11 +70,8 @@ describe("probeMattermost", () => {

73707471

await probeMattermost("https://mm.example.com", "bot-token", 2500, true);

757276-

expect(mockFetchGuard).toHaveBeenCalledWith(

77-

expect.objectContaining({

78-

policy: { allowPrivateNetwork: true },

79-

}),

80-

);

73+

const [fetchCall] = mockFetchGuard.mock.calls[0] ?? [];

74+

expect(fetchCall?.policy).toStrictEqual({ allowPrivateNetwork: true });

8175

});

82768377

it("returns API error details from JSON response", async () => {

@@ -90,13 +84,14 @@ describe("probeMattermost", () => {

9084

release: mockRelease,

9185

});

928693-

await expect(probeMattermost("https://mm.example.com", "bad-token")).resolves.toEqual(

94-

expect.objectContaining({

95-

ok: false,

96-

status: 401,

97-

error: "invalid auth token",

98-

}),

99-

);

87+

const result = await probeMattermost("https://mm.example.com", "bad-token");

88+

const { elapsedMs, ...stableResult } = result;

89+

expect(stableResult).toStrictEqual({

90+

ok: false,

91+

status: 401,

92+

error: "invalid auth token",

93+

});

94+

expect(elapsedMs).toBeGreaterThanOrEqual(0);

10095

expect(mockRelease).toHaveBeenCalledTimes(1);

10196

});

10297

@@ -110,25 +105,27 @@ describe("probeMattermost", () => {

110105

release: mockRelease,

111106

});

112107113-

await expect(probeMattermost("https://mm.example.com", "token")).resolves.toEqual(

114-

expect.objectContaining({

115-

ok: false,

116-

status: 403,

117-

error: "Forbidden",

118-

}),

119-

);

108+

const result = await probeMattermost("https://mm.example.com", "token");

109+

const { elapsedMs, ...stableResult } = result;

110+

expect(stableResult).toStrictEqual({

111+

ok: false,

112+

status: 403,

113+

error: "Forbidden",

114+

});

115+

expect(elapsedMs).toBeGreaterThanOrEqual(0);

120116

expect(mockRelease).toHaveBeenCalledTimes(1);

121117

});

122118123119

it("returns fetch error when request throws", async () => {

124120

mockFetchGuard.mockRejectedValueOnce(new Error("network down"));

125121126-

await expect(probeMattermost("https://mm.example.com", "token")).resolves.toEqual(

127-

expect.objectContaining({

128-

ok: false,

129-

status: null,

130-

error: "network down",

131-

}),

132-

);

122+

const result = await probeMattermost("https://mm.example.com", "token");

123+

const { elapsedMs, ...stableResult } = result;

124+

expect(stableResult).toStrictEqual({

125+

ok: false,

126+

status: null,

127+

error: "network down",

128+

});

129+

expect(elapsedMs).toBeGreaterThanOrEqual(0);

133130

});

134131

});