test: make suites safe without isolation (#78834)

* test: make suites safe without isolation

* fix: narrow auth profile credential types

* test: inject channel module loader factory locally
This commit is contained in:
Peter Steinberger
2026-05-07 08:43:29 +01:00
committed by GitHub
parent 9ffe290a17
commit 1ef85c7d4c
182 changed files with 1501 additions and 834 deletions

View File

@@ -13,6 +13,8 @@ import type { OpenClawConfig } from "../api.js";
import { resolveTwitchToken, type TwitchTokenSource } from "./token.js";
describe("token", () => {
const originalAccessToken = process.env.OPENCLAW_TWITCH_ACCESS_TOKEN;
// Multi-account config for testing non-default accounts
const mockMultiAccountConfig = {
channels: {
@@ -47,7 +49,11 @@ describe("token", () => {
afterEach(() => {
vi.restoreAllMocks();
delete process.env.OPENCLAW_TWITCH_ACCESS_TOKEN;
if (originalAccessToken === undefined) {
delete process.env.OPENCLAW_TWITCH_ACCESS_TOKEN;
} else {
process.env.OPENCLAW_TWITCH_ACCESS_TOKEN = originalAccessToken;
}
});
describe("resolveTwitchToken", () => {