























@@ -536,7 +536,7 @@ describe("discordPlugin outbound", () => {
536536includeApplication: true,
537537}),
538538);
539-expect(statusPatches.some((patch) => "bot" in patch || "application" in patch)).toBe(false);
539+expect(statusPatches.filter((patch) => "bot" in patch || "application" in patch)).toEqual([]);
540540541541if (!resolveProbe) {
542542throw new Error("Expected Discord startup probe resolver to be initialized");
@@ -550,12 +550,20 @@ describe("discordPlugin outbound", () => {
550550551551await vi.waitFor(() =>
552552expect(
553-statusPatches.some(
554-(patch) =>
555-(patch.bot as { username?: string } | undefined)?.username === "AsyncBob" &&
556-Boolean(patch.application),
557-),
558-).toBe(true),
553+statusPatches
554+.filter(
555+(patch) => (patch.bot as { username?: string } | undefined)?.username === "AsyncBob",
556+)
557+.map((patch) => ({
558+bot: patch.bot,
559+application: patch.application,
560+})),
561+).toEqual([
562+{
563+bot: { username: "AsyncBob" },
564+application: { intents: { messageContent: "limited" } },
565+},
566+]),
559567);
560568});
561569@@ -585,14 +593,19 @@ describe("discordPlugin outbound", () => {
585593586594await vi.waitFor(() =>
587595expect(
588-statusPatches.some(
589-(patch) =>
590-"bot" in patch &&
591-"application" in patch &&
592-patch.bot === undefined &&
593-patch.application === undefined,
594-),
595-).toBe(true),
596+statusPatches
597+.filter(
598+(patch) =>
599+"bot" in patch &&
600+"application" in patch &&
601+patch.bot === undefined &&
602+patch.application === undefined,
603+)
604+.map((patch) => ({
605+bot: patch.bot,
606+application: patch.application,
607+})),
608+).toEqual([{ bot: undefined, application: undefined }]),
596609);
597610});
598611@@ -617,14 +630,19 @@ describe("discordPlugin outbound", () => {
617630618631await vi.waitFor(() =>
619632expect(
620-statusPatches.some(
621-(patch) =>
622-"bot" in patch &&
623-"application" in patch &&
624-patch.bot === undefined &&
625-patch.application === undefined,
626-),
627-).toBe(true),
633+statusPatches
634+.filter(
635+(patch) =>
636+"bot" in patch &&
637+"application" in patch &&
638+patch.bot === undefined &&
639+patch.application === undefined,
640+)
641+.map((patch) => ({
642+bot: patch.bot,
643+application: patch.application,
644+})),
645+).toEqual([{ bot: undefined, application: undefined }]),
628646);
629647});
630648此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。