mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 14:04:31 +00:00
refactor(test): centralize auth test agent-dir helpers
This commit is contained in:
@@ -7,17 +7,10 @@ import {
|
||||
createExitThrowingRuntime,
|
||||
createWizardPrompter,
|
||||
readAuthProfilesForAgent,
|
||||
requireOpenClawAgentDir,
|
||||
setupAuthTestEnv,
|
||||
} from "./test-wizard-helpers.js";
|
||||
|
||||
const requireAgentDir = () => {
|
||||
const agentDir = process.env.OPENCLAW_AGENT_DIR;
|
||||
if (!agentDir) {
|
||||
throw new Error("OPENCLAW_AGENT_DIR not set");
|
||||
}
|
||||
return agentDir;
|
||||
};
|
||||
|
||||
function createPrompter(overrides: Partial<WizardPrompter>): WizardPrompter {
|
||||
return createWizardPrompter(overrides, { defaultSelect: "" });
|
||||
}
|
||||
@@ -40,7 +33,7 @@ describe("applyAuthChoice (moonshot)", () => {
|
||||
async function readAuthProfiles() {
|
||||
return await readAuthProfilesForAgent<{
|
||||
profiles?: Record<string, { key?: string }>;
|
||||
}>(requireAgentDir());
|
||||
}>(requireOpenClawAgentDir());
|
||||
}
|
||||
|
||||
afterEach(async () => {
|
||||
|
||||
Reference in New Issue
Block a user