test: tighten twitch setup validation assertions

This commit is contained in:
Peter Steinberger
2026-05-09 04:29:13 +01:00
parent c6faba0713
commit 535d70c202

View File

@@ -113,11 +113,11 @@ describe("setup surface helpers", () => {
const result = await promptUsername(mockPrompter, null);
expect(result).toBe("mybot");
expect(mockPromptText).toHaveBeenCalledWith({
message: "Twitch bot username",
initialValue: "",
validate: expect.any(Function),
});
const promptArgs = mockPromptText.mock.calls[0]?.[0];
expect(promptArgs?.message).toBe("Twitch bot username");
expect(promptArgs?.initialValue).toBe("");
expect(promptArgs?.validate?.("")).toBe("Required");
expect(promptArgs?.validate?.("mybot")).toBeUndefined();
});
});
@@ -128,11 +128,11 @@ describe("setup surface helpers", () => {
const result = await promptClientId(mockPrompter, null);
expect(result).toBe("abc123xyz");
expect(mockPromptText).toHaveBeenCalledWith({
message: "Twitch Client ID",
initialValue: "",
validate: expect.any(Function),
});
const promptArgs = mockPromptText.mock.calls[0]?.[0];
expect(promptArgs?.message).toBe("Twitch Client ID");
expect(promptArgs?.initialValue).toBe("");
expect(promptArgs?.validate?.("")).toBe("Required");
expect(promptArgs?.validate?.("abc123xyz")).toBeUndefined();
});
});