






















@@ -888,7 +888,7 @@ describe("preflightDiscordMessage", () => {
888888889889const result = await runMentionOnlyBotPreflight({ channelId, guildId, message });
890890891-expect(result).not.toBeNull();
891+expect(expectPreflightResult(result)).toEqual(expect.any(Object));
892892});
893893894894it("hydrates mention metadata from REST when bot mention syntax is present but mentions are missing", async () => {
@@ -934,7 +934,7 @@ describe("preflightDiscordMessage", () => {
934934botUserId: botId,
935935});
936936937-expect(result).not.toBeNull();
937+expect(expectPreflightResult(result)).toEqual(expect.any(Object));
938938});
939939940940it("still drops bot control commands without a real mention when allowBots=mentions", async () => {
@@ -973,7 +973,7 @@ describe("preflightDiscordMessage", () => {
973973974974const result = await runMentionOnlyBotPreflight({ channelId, guildId, message });
975975976-expect(result).not.toBeNull();
976+expect(expectPreflightResult(result)).toEqual(expect.any(Object));
977977});
978978979979it("routes ordinary guild text control commands through authorization instead of dropping them", async () => {
@@ -1015,11 +1015,11 @@ describe("preflightDiscordMessage", () => {
10151015},
10161016});
101710171018-expect(result).not.toBeNull();
1019-expect(result?.baseText).toBe("/steer keep digging");
1020-expect(result?.commandAuthorized).toBe(true);
1021-expect(result?.shouldRequireMention).toBe(true);
1022-expect(result?.shouldBypassMention).toBe(true);
1018+const preflight = expectPreflightResult(result);
1019+expect(preflight.baseText).toBe("/steer keep digging");
1020+expect(preflight.commandAuthorized).toBe(true);
1021+expect(preflight.shouldRequireMention).toBe(true);
1022+expect(preflight.shouldBypassMention).toBe(true);
10231023});
1024102410251025it("still drops Discord native command echo messages", async () => {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。