test: check twitch client log messages

This commit is contained in:
Shakker
2026-05-11 15:51:05 +01:00
parent ffb814c420
commit 9bfd1947d5

View File

@@ -138,9 +138,7 @@ describe("TwitchClientManager", () => {
// New implementation: connect is called, channels are passed to constructor
expect(mockConnect).toHaveBeenCalledTimes(1);
expect(mockLogger.info).toHaveBeenCalledWith(
expect.stringContaining("Connected to Twitch as testbot"),
);
expect(mockLogger.info).toHaveBeenCalledWith("Connected to Twitch as testbot");
});
it("should use account username as default channel when channel not specified", async () => {
@@ -213,9 +211,7 @@ describe("TwitchClientManager", () => {
"Missing Twitch client ID",
);
expect(mockLogger.error).toHaveBeenCalledWith(
expect.stringContaining("Missing Twitch client ID"),
);
expect(mockLogger.error).toHaveBeenCalledWith("Missing Twitch client ID for account testbot");
});
it("should throw error when token is missing", async () => {
@@ -372,9 +368,7 @@ describe("TwitchClientManager", () => {
expect(result.ok).toBe(false);
expect(result.error).toBe("Rate limited");
expect(mockLogger.error).toHaveBeenCalledWith(
expect.stringContaining("Failed to send message"),
);
expect(mockLogger.error).toHaveBeenCalledWith("Failed to send message: Rate limited");
});
it("should handle unknown error types", async () => {