test: preload onboarding command modules in hot suites

This commit is contained in:
Peter Steinberger
2026-02-22 15:01:51 +00:00
parent b6ac0eef5d
commit 71747a7688
3 changed files with 32 additions and 13 deletions

View File

@@ -8,7 +8,6 @@ import { MINIMAX_API_BASE_URL, MINIMAX_CN_API_BASE_URL } from "./onboard-auth.js
import {
createThrowingRuntime,
readJsonFile,
runNonInteractiveOnboardingWithDefaults,
type NonInteractiveRuntime,
} from "./onboard-non-interactive.test-helpers.js";
import { OPENAI_DEFAULT_MODEL } from "./openai-model-default.js";
@@ -28,6 +27,15 @@ vi.mock("./onboard-helpers.js", async (importOriginal) => {
};
});
const { runNonInteractiveOnboarding } = await import("./onboard-non-interactive.js");
const NON_INTERACTIVE_DEFAULT_OPTIONS = {
nonInteractive: true,
skipHealth: true,
skipChannels: true,
json: true,
} as const;
let ensureAuthProfileStore: typeof import("../agents/auth-profiles.js").ensureAuthProfileStore;
let upsertAuthProfile: typeof import("../agents/auth-profiles.js").upsertAuthProfile;
@@ -95,6 +103,19 @@ async function withOnboardEnv(
}
}
async function runNonInteractiveOnboardingWithDefaults(
runtime: NonInteractiveRuntime,
options: Record<string, unknown>,
): Promise<void> {
await runNonInteractiveOnboarding(
{
...NON_INTERACTIVE_DEFAULT_OPTIONS,
...options,
},
runtime,
);
}
async function runOnboardingAndReadConfig(
env: OnboardEnv,
options: Record<string, unknown>,