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

推荐订阅源

月光博客
月光博客
人人都是产品经理
人人都是产品经理
博客园 - 聂微东
WordPress大学
WordPress大学
S
SegmentFault 最新的问题
博客园 - Franky
V
V2EX
Y
Y Combinator Blog
Google DeepMind News
Google DeepMind News
J
Java Code Geeks
T
The Blog of Author Tim Ferriss
罗磊的独立博客
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Jina AI
Jina AI
博客园 - 叶小钗
F
Fortinet All Blogs
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
A
About on SuperTechFans
M
MIT News - Artificial intelligence
云风的 BLOG
云风的 BLOG
Last Week in AI
Last Week in AI
D
Docker
博客园 - 【当耐特】
阮一峰的网络日志
阮一峰的网络日志

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 qqbot adapter mock reads · openclaw/openclaw...
steipete · 2026-05-13 · via Recent Commits to openclaw:main

@@ -18,6 +18,14 @@ type SentMediaParams = {

1818

mediaUrl?: string;

1919

};

202021+

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

22+

const call = mock.mock.calls[mock.mock.calls.length - 1];

23+

if (!call) {

24+

throw new Error(`expected ${label} call`);

25+

}

26+

return call[0];

27+

}

28+2129

vi.mock("./bridge/gateway.js", () => ({}));

2230

vi.mock("./engine/messaging/outbound.js", () => ({

2331

sendText: sendTextMock,

@@ -48,9 +56,9 @@ describe("qqbot message adapter", () => {

4856

to: "qqbot:c2c:user-1",

4957

text: "hello",

5058

});

51-

const sent = sendTextMock.mock.calls.at(-1)?.[0] as SentTextParams | undefined;

52-

expect(sent?.to).toBe("qqbot:c2c:user-1");

53-

expect(sent?.text).toBe("hello");

59+

const sent = latestMockArg(sendTextMock, "sendText") as SentTextParams;

60+

expect(sent.to).toBe("qqbot:c2c:user-1");

61+

expect(sent.text).toBe("hello");

5462

expect(result?.receipt.platformMessageIds).toEqual(["qq-text-1"]);

5563

},

5664

media: async () => {

@@ -60,10 +68,10 @@ describe("qqbot message adapter", () => {

6068

text: "image",

6169

mediaUrl: "https://example.com/image.png",

6270

});

63-

const sent = sendMediaMock.mock.calls.at(-1)?.[0] as SentMediaParams | undefined;

64-

expect(sent?.to).toBe("qqbot:c2c:user-1");

65-

expect(sent?.text).toBe("image");

66-

expect(sent?.mediaUrl).toBe("https://example.com/image.png");

71+

const sent = latestMockArg(sendMediaMock, "sendMedia") as SentMediaParams;

72+

expect(sent.to).toBe("qqbot:c2c:user-1");

73+

expect(sent.text).toBe("image");

74+

expect(sent.mediaUrl).toBe("https://example.com/image.png");

6775

expect(result?.receipt.platformMessageIds).toEqual(["qq-media-1"]);

6876

},

6977

replyTo: async () => {

@@ -73,10 +81,10 @@ describe("qqbot message adapter", () => {

7381

text: "reply",

7482

replyToId: "msg-1",

7583

});

76-

const sent = sendTextMock.mock.calls.at(-1)?.[0] as SentTextParams | undefined;

77-

expect(sent?.to).toBe("qqbot:group:group-1");

78-

expect(sent?.text).toBe("reply");

79-

expect(sent?.replyToId).toBe("msg-1");

84+

const sent = latestMockArg(sendTextMock, "sendText") as SentTextParams;

85+

expect(sent.to).toBe("qqbot:group:group-1");

86+

expect(sent.text).toBe("reply");

87+

expect(sent.replyToId).toBe("msg-1");

8088

expect(result?.receipt.platformMessageIds).toEqual(["qq-text-1"]);

8189

},

8290

},