Files
openclaw/extensions/twitch/src/test-fixtures.ts
2026-03-18 01:29:33 -05:00

31 lines
629 B
TypeScript

import { afterEach, beforeEach, vi } from "vitest";
import type { OpenClawConfig } from "../runtime-api.js";
export const BASE_TWITCH_TEST_ACCOUNT = {
username: "testbot",
clientId: "test-client-id",
channel: "#testchannel",
};
export function makeTwitchTestConfig(account: Record<string, unknown>): OpenClawConfig {
return {
channels: {
twitch: {
accounts: {
default: account,
},
},
},
} as unknown as OpenClawConfig;
}
export function installTwitchTestHooks() {
beforeEach(() => {
vi.clearAllMocks();
});
afterEach(() => {
vi.restoreAllMocks();
});
}