
















@@ -1105,26 +1105,26 @@ describe("monitorDiscordProvider", () => {
11051105});
1106110611071107await vi.waitFor(() =>
1108-expect(
1109-vi
1110-.mocked(runtime.log)
1111-.mock.calls.some((call) => String(call[0]).includes("deploy-commands:done")),
1112-).toBe(true),
1108+expect(vi.mocked(runtime.log).mock.calls.map((call) => String(call[0]))).toEqual(
1109+expect.arrayContaining([expect.stringContaining("deploy-commands:done")]),
1110+),
11131111);
1114111211151113const messages = vi.mocked(runtime.log).mock.calls.map((call) => String(call[0]));
1116-expect(messages.some((msg) => msg.includes("fetch-application-id:start"))).toBe(true);
1117-expect(messages.some((msg) => msg.includes("fetch-application-id:done"))).toBe(true);
1118-expect(messages.some((msg) => msg.includes("deploy-commands:schedule"))).toBe(true);
1119-expect(messages.some((msg) => msg.includes("deploy-commands:scheduled"))).toBe(true);
1120-expect(messages.some((msg) => msg.includes("deploy-commands:done"))).toBe(true);
1121-expect(messages.some((msg) => msg.includes("fetch-bot-identity:start"))).toBe(true);
1122-expect(messages.some((msg) => msg.includes("fetch-bot-identity:done"))).toBe(true);
1123-expect(
1124-messages.some(
1125-(msg) => msg.includes("gateway-debug") && msg.includes("Gateway websocket opened"),
1126-),
1127-).toBe(true);
1114+expect(messages).toEqual(
1115+expect.arrayContaining([
1116+expect.stringContaining("fetch-application-id:start"),
1117+expect.stringContaining("fetch-application-id:done"),
1118+expect.stringContaining("deploy-commands:schedule"),
1119+expect.stringContaining("deploy-commands:scheduled"),
1120+expect.stringContaining("deploy-commands:done"),
1121+expect.stringContaining("fetch-bot-identity:start"),
1122+expect.stringContaining("fetch-bot-identity:done"),
1123+]),
1124+);
1125+expect(messages).toEqual(
1126+expect.arrayContaining([expect.stringMatching(/gateway-debug.*Gateway websocket opened/)]),
1127+);
11281128});
1129112911301130it("keeps Discord startup chatter quiet by default", async () => {
@@ -1136,6 +1136,8 @@ describe("monitorDiscordProvider", () => {
11361136});
1137113711381138const messages = vi.mocked(runtime.log).mock.calls.map((call) => String(call[0]));
1139-expect(messages.some((msg) => msg.includes("discord startup ["))).toBe(false);
1139+expect(messages).not.toEqual(
1140+expect.arrayContaining([expect.stringContaining("discord startup [")]),
1141+);
11401142});
11411143});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。