



























@@ -85,8 +85,10 @@ describe("createDiscordGatewaySupervisor", () => {
8585emitter.emit("error", new Error("Max reconnect attempts (0) reached after close code 1006"));
86868787expect(seen).toEqual(["disallowed-intents", "fatal"]);
88-expect(runtime.error).toHaveBeenCalledWith(
89-expect.stringContaining("suppressed late gateway reconnect-exhausted error during teardown"),
88+expect(runtime.error).toHaveBeenCalledTimes(1);
89+expect(runtime.error.mock.calls[0]).toHaveLength(1);
90+expect(String(runtime.error.mock.calls[0]?.[0])).toContain(
91+"suppressed late gateway reconnect-exhausted error during teardown",
9092);
9193});
9294@@ -116,8 +118,10 @@ describe("createDiscordGatewaySupervisor", () => {
116118supervisor.dispose();
117119118120emitter.emit("error", new Error("Max reconnect attempts (0) reached after close code 1005"));
119-expect(runtime.error).toHaveBeenCalledWith(
120-expect.stringContaining("suppressed late gateway reconnect-exhausted error after dispose"),
121+expect(runtime.error).toHaveBeenCalledTimes(1);
122+expect(runtime.error.mock.calls[0]).toHaveLength(1);
123+expect(String(runtime.error.mock.calls[0]?.[0])).toContain(
124+"suppressed late gateway reconnect-exhausted error after dispose",
121125);
122126});
123127@@ -139,10 +143,9 @@ describe("createDiscordGatewaySupervisor", () => {
139143emitter.emit("error", second);
140144141145expect(runtime.error).toHaveBeenCalledTimes(1);
142-expect(runtime.error).toHaveBeenCalledWith(
143-expect.stringContaining(
144-"suppressed late gateway fatal error after dispose: TypeError @ gatewayCrash (discord-gateway.js:12:34)",
145-),
146+expect(runtime.error.mock.calls[0]).toHaveLength(1);
147+expect(String(runtime.error.mock.calls[0]?.[0])).toContain(
148+"suppressed late gateway fatal error after dispose: TypeError @ gatewayCrash (discord-gateway.js:12:34)",
146149);
147150});
148151});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。