Skip to content

Commit 0100c27

Browse files
committed
test: route oauth helper env setup
1 parent a8ca961 commit 0100c27

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎src/agents/auth-profiles/oauth-test-utils.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import fs from "node:fs/promises";
77
import os from "node:os";
88
import path from "node:path";
99
import { closeOpenClawAgentDatabasesForTest } from "../../state/openclaw-agent-db.js";
10+
import { setTestEnvValue } from "../../test-utils/env.js";
1011
import type { resolveApiKeyForProfile } from "./oauth.js";
1112
import { loadPersistedAuthProfileStore } from "./persisted.js";
1213
import { saveAuthProfileStore } from "./store.js";
@@ -73,8 +74,8 @@ export async function createOAuthTestTempRoot(prefix: string): Promise<string> {
7374
/** Create and export the main agent dir for OAuth tests. */
7475
export async function createOAuthMainAgentDir(stateDir: string): Promise<string> {
7576
const agentDir = path.join(stateDir, "agents", "main", "agent");
76-
process.env.OPENCLAW_STATE_DIR = stateDir;
77-
process.env.OPENCLAW_AGENT_DIR = agentDir;
77+
setTestEnvValue("OPENCLAW_STATE_DIR", stateDir);
78+
setTestEnvValue("OPENCLAW_AGENT_DIR", agentDir);
7879
await fs.mkdir(agentDir, { recursive: true });
7980
return agentDir;
8081
}

0 commit comments

Comments
 (0)