test: tighten discord audio preflight assertions · openclaw/openclaw@de21569
shakkernerd
·
2026-05-09
·
via Recent Commits to openclaw:main
File tree
extensions/discord/src/monitor
| Original file line number | Diff line number | Diff line change |
|---|
@@ -1484,9 +1484,9 @@ describe("preflightDiscordMessage", () => {
|
1484 | 1484 | }), |
1485 | 1485 | }), |
1486 | 1486 | ); |
1487 | | -expect(result).not.toBeNull(); |
1488 | | -expect(result?.wasMentioned).toBe(true); |
1489 | | -expect(result?.preflightAudioTranscript).toBe("hey openclaw"); |
| 1487 | +const preflight = expectPreflightResult(result); |
| 1488 | +expect(preflight.wasMentioned).toBe(true); |
| 1489 | +expect(preflight.preflightAudioTranscript).toBe("hey openclaw"); |
1490 | 1490 | }); |
1491 | 1491 | |
1492 | 1492 | it("does not transcribe guild audio from unauthorized members", async () => { |
@@ -1629,7 +1629,7 @@ describe("preflightDiscordMessage", () => {
|
1629 | 1629 | "guild-1": { channels: { [channelId]: { enabled: true, requireMention: true } } }, |
1630 | 1630 | }, |
1631 | 1631 | }); |
1632 | | -expect(result).not.toBeNull(); |
| 1632 | +expect(expectPreflightResult(result)).toEqual(expect.any(Object)); |
1633 | 1633 | } finally { |
1634 | 1634 | routeSpy.mockRestore(); |
1635 | 1635 | ensureSpy.mockRestore(); |
@@ -1701,7 +1701,7 @@ describe("shouldIgnoreBoundThreadWebhookMessage", () => {
|
1701 | 1701 | webhookId: "wh-1", |
1702 | 1702 | webhookToken: "tok-1", |
1703 | 1703 | }); |
1704 | | -expect(binding).not.toBeNull(); |
| 1704 | +expect(binding).toEqual(expect.any(Object)); |
1705 | 1705 | |
1706 | 1706 | manager.unbindThread({ |
1707 | 1707 | threadId: "thread-1", |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。