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

推荐订阅源

J
Java Code Geeks
腾讯CDC
博客园 - 聂微东
爱范儿
爱范儿
罗磊的独立博客
P
Proofpoint News Feed
博客园 - Franky
博客园 - 三生石上(FineUI控件)
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
酷 壳 – CoolShell
酷 壳 – CoolShell
Jina AI
Jina AI
Blog — PlanetScale
Blog — PlanetScale
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 司徒正美
美团技术团队
MongoDB | Blog
MongoDB | Blog
WordPress大学
WordPress大学
A
About on SuperTechFans
I
InfoQ
博客园_首页
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
H
Help Net Security
Microsoft Azure Blog
Microsoft Azure Blog
G
Google Developers 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 discord gateway proxy assertions · openclaw...
shakkernerd · 2026-05-11 · via Recent Commits to openclaw:main

@@ -278,8 +278,9 @@ describe("createDiscordGatewayPlugin", () => {

278278

expect((plugin as unknown as { gatewayInfo?: { url?: string } }).gatewayInfo?.url).toBe(

279279

"wss://gateway.discord.gg/",

280280

);

281-

expect(runtime.log).toHaveBeenCalledWith(

282-

expect.stringContaining("discord: gateway metadata lookup failed transiently"),

281+

expect(runtime.log).toHaveBeenCalledTimes(1);

282+

expect(String(runtime.log.mock.calls[0]?.[0])).toContain(

283+

"discord: gateway metadata lookup failed transiently",

283284

);

284285

}

285286

@@ -326,12 +327,13 @@ describe("createDiscordGatewayPlugin", () => {

326327327328

await registerGatewayClientWithMetadata({ plugin, fetchMock: globalFetchMock });

328329329-

expect(globalFetchMock).toHaveBeenCalledWith(

330-

"https://discord.com/api/v10/gateway/bot",

331-

expect.objectContaining({

332-

headers: { Authorization: "Bot token-123" },

333-

}),

334-

);

330+

expect(globalFetchMock).toHaveBeenCalledTimes(1);

331+

const fetchInit = globalFetchMock.mock.calls[0]?.[1] as

332+

| { headers?: Record<string, string>; signal?: unknown }

333+

| undefined;

334+

expect(globalFetchMock.mock.calls[0]?.[0]).toBe("https://discord.com/api/v10/gateway/bot");

335+

expect(fetchInit?.headers).toEqual({ Authorization: "Bot token-123" });

336+

expect(fetchInit?.signal).toBeInstanceOf(AbortSignal);

335337

expect(baseRegisterClientSpy).toHaveBeenCalledTimes(1);

336338

});

337339

@@ -346,16 +348,14 @@ describe("createDiscordGatewayPlugin", () => {

346348

.createWebSocket;

347349

createWebSocket("wss://gateway.discord.gg");

348350349-

expect(httpsAgentSpy).toHaveBeenCalledWith(

350-

expect.objectContaining({ lookup: expect.any(Function) }),

351-

);

352-

expect(webSocketSpy).toHaveBeenCalledWith(

353-

"wss://gateway.discord.gg",

354-

expect.objectContaining({

355-

agent: getLastAgent(),

356-

handshakeTimeout: 30_000,

357-

}),

358-

);

351+

expect(httpsAgentSpy).toHaveBeenCalledTimes(1);

352+

const httpsAgentOptions = httpsAgentSpy.mock.calls[0]?.[0] as { lookup?: unknown } | undefined;

353+

expect(Object.keys(httpsAgentOptions ?? {})).toEqual(["lookup"]);

354+

expect(typeof httpsAgentOptions?.lookup).toBe("function");

355+

expect(webSocketSpy).toHaveBeenCalledWith("wss://gateway.discord.gg", {

356+

agent: getLastAgent(),

357+

handshakeTimeout: 30_000,

358+

});

359359

expect(wsProxyAgentSpy).not.toHaveBeenCalled();

360360

});

361361

@@ -467,10 +467,10 @@ describe("createDiscordGatewayPlugin", () => {

467467

createWebSocket("wss://gateway.discord.gg");

468468469469

expect(wsProxyAgentSpy).toHaveBeenCalledWith("http://127.0.0.1:8080");

470-

expect(webSocketSpy).toHaveBeenCalledWith(

471-

"wss://gateway.discord.gg",

472-

expect.objectContaining({ agent: getLastProxyAgent(), handshakeTimeout: 30_000 }),

473-

);

470+

expect(webSocketSpy).toHaveBeenCalledWith("wss://gateway.discord.gg", {

471+

agent: getLastProxyAgent(),

472+

handshakeTimeout: 30_000,

473+

});

474474

expect(runtime.log).toHaveBeenCalledWith("discord: gateway proxy enabled");

475475

expect(runtime.error).not.toHaveBeenCalled();

476476

});

@@ -498,12 +498,13 @@ describe("createDiscordGatewayPlugin", () => {

498498499499

await registerGatewayClientWithMetadata({ plugin, fetchMock: globalFetchMock });

500500501-

expect(globalFetchMock).toHaveBeenCalledWith(

502-

"https://discord.com/api/v10/gateway/bot",

503-

expect.objectContaining({

504-

headers: { Authorization: "Bot token-123" },

505-

}),

506-

);

501+

expect(globalFetchMock).toHaveBeenCalledTimes(1);

502+

const fetchInit = globalFetchMock.mock.calls[0]?.[1] as

503+

| { headers?: Record<string, string>; signal?: unknown }

504+

| undefined;

505+

expect(globalFetchMock.mock.calls[0]?.[0]).toBe("https://discord.com/api/v10/gateway/bot");

506+

expect(fetchInit?.headers).toEqual({ Authorization: "Bot token-123" });

507+

expect(fetchInit?.signal).toBeInstanceOf(AbortSignal);

507508

expect(baseRegisterClientSpy).toHaveBeenCalledTimes(1);

508509

});

509510

@@ -546,7 +547,8 @@ describe("createDiscordGatewayPlugin", () => {

546547

});

547548548549

expect(Object.getPrototypeOf(plugin)).not.toBe(GatewayPlugin.prototype);

549-

expect(runtime.error).toHaveBeenCalledWith(expect.stringContaining("loopback host"));

550+

expect(runtime.error).toHaveBeenCalledTimes(1);

551+

expect(String(runtime.error.mock.calls[0]?.[0])).toContain("loopback host");

550552

expect(runtime.log).not.toHaveBeenCalled();

551553

});

552554

@@ -577,8 +579,9 @@ describe("createDiscordGatewayPlugin", () => {

577579

expect((plugin as unknown as { gatewayInfo?: { url?: string } }).gatewayInfo?.url).toBe(

578580

"wss://gateway.discord.gg/",

579581

);

580-

expect(runtime.log).toHaveBeenCalledWith(

581-

expect.stringContaining("discord: gateway metadata lookup failed transiently"),

582+

expect(runtime.log).toHaveBeenCalledTimes(1);

583+

expect(String(runtime.log.mock.calls[0]?.[0])).toContain(

584+

"discord: gateway metadata lookup failed transiently",

582585

);

583586

});

584587