From 900d7b74c99277d4f992ed6980c855fff51f5c0f Mon Sep 17 00:00:00 2001 From: jaydenfyi <213395523+jaydenfyi@users.noreply.github.com> Date: Sun, 25 Jan 2026 20:05:56 +0800 Subject: [PATCH] update tests --- extensions/twitch/src/probe.test.ts | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/extensions/twitch/src/probe.test.ts b/extensions/twitch/src/probe.test.ts index 6e28cf5e1..21d43ee18 100644 --- a/extensions/twitch/src/probe.test.ts +++ b/extensions/twitch/src/probe.test.ts @@ -69,16 +69,15 @@ describe("probeTwitch", () => { }); it("returns error when username is missing", async () => { - const account = { ...mockAccount, username: "" as unknown as string }; + const account = { ...mockAccount, username: "" }; const result = await probeTwitch(account, 5000); expect(result.ok).toBe(false); expect(result.error).toContain("missing credentials"); - expect(result.elapsedMs).toBeGreaterThanOrEqual(0); }); it("returns error when token is missing", async () => { - const account = { ...mockAccount, token: "" as unknown as string }; + const account = { ...mockAccount, token: "" }; const result = await probeTwitch(account, 5000); expect(result.ok).toBe(false); @@ -102,7 +101,6 @@ describe("probeTwitch", () => { expect(result.connected).toBe(true); expect(result.username).toBe("testbot"); expect(result.channel).toBe("testchannel"); // uses account's configured channel - expect(result.elapsedMs).toBeGreaterThan(0); }); it("uses custom channel when specified", async () => { @@ -149,13 +147,6 @@ describe("probeTwitch", () => { mockConnect.mockImplementation(defaultConnectImpl); }); - it("measures elapsed time", async () => { - const result = await probeTwitch(mockAccount, 5000); - - expect(result.ok).toBe(true); - expect(result.elapsedMs).toBeGreaterThan(0); - }); - it("handles connection errors gracefully", async () => { mockConnect.mockImplementationOnce(async () => { // Simulate connection failure by calling disconnect handler