test: speed up onboarding provider auth and temp-path guard scans

This commit is contained in:
Peter Steinberger
2026-02-22 13:24:59 +00:00
parent 494bb685f8
commit 7a2b05314a
2 changed files with 20 additions and 2 deletions

View File

@@ -1,7 +1,7 @@
import fs from "node:fs/promises";
import path from "node:path";
import { setTimeout as delay } from "node:timers/promises";
import { beforeAll, describe, expect, it } from "vitest";
import { beforeAll, describe, expect, it, vi } from "vitest";
import { makeTempWorkspace } from "../test-helpers/workspace.js";
import { withEnvAsync } from "../test-utils/env.js";
import { MINIMAX_API_BASE_URL, MINIMAX_CN_API_BASE_URL } from "./onboard-auth.js";
@@ -17,6 +17,17 @@ type OnboardEnv = {
configPath: string;
runtime: NonInteractiveRuntime;
};
const ensureWorkspaceAndSessionsMock = vi.fn(async (..._args: unknown[]) => {});
vi.mock("./onboard-helpers.js", async (importOriginal) => {
const actual = await importOriginal<typeof import("./onboard-helpers.js")>();
return {
...actual,
ensureWorkspaceAndSessions: ensureWorkspaceAndSessionsMock,
};
});
let ensureAuthProfileStore: typeof import("../agents/auth-profiles.js").ensureAuthProfileStore;
let upsertAuthProfile: typeof import("../agents/auth-profiles.js").upsertAuthProfile;