test: make shell env path cache tests platform deterministic

This commit is contained in:
Peter Steinberger
2026-02-19 07:02:26 +00:00
parent 231f2af7df
commit c37cf02f29
3 changed files with 39 additions and 25 deletions

View File

@@ -140,11 +140,13 @@ export function getShellPathFromLoginShell(opts: {
env: NodeJS.ProcessEnv;
timeoutMs?: number;
exec?: typeof execFileSync;
platform?: NodeJS.Platform;
}): string | null {
if (cachedShellPath !== undefined) {
return cachedShellPath;
}
if (process.platform === "win32") {
const platform = opts.platform ?? process.platform;
if (platform === "win32") {
cachedShellPath = null;
return cachedShellPath;
}