fix(twitch): wait through auth retry disconnects · openclaw/openclaw@9177860
steipete
·
2026-05-24
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -201,7 +201,7 @@ describe("TwitchClientManager", () => {
|
201 | 201 | expect(client1).toBe(client2); |
202 | 202 | }); |
203 | 203 | |
204 | | -it("waits for disconnect after authentication failure retry events", async () => { |
| 204 | +it("waits through authentication failure retry disconnects", async () => { |
205 | 205 | mockConnect.mockImplementationOnce(() => {}); |
206 | 206 | |
207 | 207 | const connection = manager.getClient(testAccount); |
@@ -224,7 +224,11 @@ describe("TwitchClientManager", () => {
|
224 | 224 | ); |
225 | 225 | |
226 | 226 | disconnectHandlers[0]?.(false, new Error("disconnected")); |
227 | | -await expect(connection).rejects.toThrow("disconnected"); |
| 227 | +await Promise.resolve(); |
| 228 | +expect(settled).toBe(false); |
| 229 | + |
| 230 | +authSuccessHandlers[0]?.(); |
| 231 | +await expect(connection).resolves.toBeTruthy(); |
228 | 232 | }); |
229 | 233 | |
230 | 234 | it("does not cache pending connections after disconnectAll", async () => { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。