diff --git a/tests/ConfigApp.test.tsx b/tests/ConfigApp.test.tsx index 00e8a6f..e9cb021 100644 --- a/tests/ConfigApp.test.tsx +++ b/tests/ConfigApp.test.tsx @@ -16,6 +16,7 @@ import * as auth from "@/lib/auth.js"; import * as backend from "@/lib/backend.js"; import * as codegraph from "@/lib/codegraph.js"; import * as configure from "@/lib/configure.js"; +import * as shims from "@/lib/shims.js"; // ConfigApp shares its state machine with InstallApp (both render ). // These tests cover only the config-specific deltas: @@ -81,6 +82,17 @@ beforeEach(() => { created: true, }, ]); + // The finalize Phase calls installShims(), and on Windows that shells out to + // a real `powershell -Command` (execFileSync — NOT the mocked execFile) to + // rewrite the user-scope PATH in the registry: a synchronous spawn that + // blocks the event loop long enough to starve waitForFrame, and that mutates + // the PATH of whatever machine runs the suite. See InstallApp.test.tsx. + vi.spyOn(shims, "installShims").mockReturnValue({ + shimDir: join(configAppTempHome, ".codev-hub", "bin"), + shimsWritten: [], + rcFilesUpdated: [], + windowsUserPathUpdated: false, + }); }); type ExecCb = (error: Error | null, stdout: string, stderr: string) => void; diff --git a/tests/InstallApp.test.tsx b/tests/InstallApp.test.tsx index 5f575a4..516cad1 100644 --- a/tests/InstallApp.test.tsx +++ b/tests/InstallApp.test.tsx @@ -18,6 +18,7 @@ import * as codegraph from "@/lib/codegraph.js"; import * as configure from "@/lib/configure.js"; import { FALLBACK_MODEL } from "@/lib/const.js"; import * as npm from "@/lib/npm.js"; +import * as shims from "@/lib/shims.js"; import { vscodeSettingsPath, vscodeUserDataDir, @@ -97,6 +98,20 @@ beforeEach(() => { created: true, }, ]); + // The finalize Phase calls installShims(), and on Windows that shells out to + // a real `powershell -Command` (execFileSync — NOT the mocked execFile) to + // rewrite the user-scope PATH in the registry. That's a synchronous spawn + // which blocks the event loop for ~10s on its cold start, so the first flow + // to reach finalize blows past waitForFrame's budget and never renders the + // done screen — and it mutates the PATH of whatever machine runs the suite. + // lib/shims.test.ts skips its installShims block on Windows for the same + // reason; nothing here asserts shim files, so stub the whole call. + vi.spyOn(shims, "installShims").mockReturnValue({ + shimDir: join(installAppTempHome, ".codev-hub", "bin"), + shimsWritten: [], + rcFilesUpdated: [], + windowsUserPathUpdated: false, + }); }); type ExecCb = (error: Error | null, stdout: string, stderr: string) => void;