mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 18:08:27 +00:00
fix: align extension tests and fetch typing for gate stability (#12816)
This commit is contained in:
@@ -54,7 +54,8 @@ vi.mock("@twurple/auth", () => ({
|
||||
describe("probeTwitch", () => {
|
||||
const mockAccount: TwitchAccountConfig = {
|
||||
username: "testbot",
|
||||
token: "oauth:test123456789",
|
||||
accessToken: "oauth:test123456789",
|
||||
clientId: "test-client-id",
|
||||
channel: "testchannel",
|
||||
};
|
||||
|
||||
@@ -74,7 +75,7 @@ describe("probeTwitch", () => {
|
||||
});
|
||||
|
||||
it("returns error when token is missing", async () => {
|
||||
const account = { ...mockAccount, token: "" };
|
||||
const account = { ...mockAccount, accessToken: "" };
|
||||
const result = await probeTwitch(account, 5000);
|
||||
|
||||
expect(result.ok).toBe(false);
|
||||
@@ -84,7 +85,7 @@ describe("probeTwitch", () => {
|
||||
it("attempts connection regardless of token prefix", async () => {
|
||||
// Note: probeTwitch doesn't validate token format - it tries to connect with whatever token is provided
|
||||
// The actual connection would fail in production with an invalid token
|
||||
const account = { ...mockAccount, token: "raw_token_no_prefix" };
|
||||
const account = { ...mockAccount, accessToken: "raw_token_no_prefix" };
|
||||
const result = await probeTwitch(account, 5000);
|
||||
|
||||
// With mock, connection succeeds even without oauth: prefix
|
||||
@@ -166,7 +167,7 @@ describe("probeTwitch", () => {
|
||||
it("trims token before validation", async () => {
|
||||
const account: TwitchAccountConfig = {
|
||||
...mockAccount,
|
||||
token: " oauth:test123456789 ",
|
||||
accessToken: " oauth:test123456789 ",
|
||||
};
|
||||
|
||||
const result = await probeTwitch(account, 5000);
|
||||
|
||||
Reference in New Issue
Block a user