fix(ci): make Windows unit tests deterministic

This commit is contained in:
Peter Steinberger
2026-02-15 03:46:43 +00:00
parent cb54a532f0
commit a47b08d551
2 changed files with 8 additions and 45 deletions

View File

@@ -99,9 +99,10 @@ async function execLaunchctl(
args: string[],
): Promise<{ stdout: string; stderr: string; code: number }> {
try {
const { stdout, stderr } = await execFileAsync("launchctl", args, {
encoding: "utf8",
});
const isWindows = process.platform === "win32";
const file = isWindows ? (process.env.ComSpec ?? "cmd.exe") : "launchctl";
const fileArgs = isWindows ? ["/d", "/s", "/c", "launchctl", ...args] : args;
const { stdout, stderr } = await execFileAsync(file, fileArgs, { encoding: "utf8" });
return {
stdout: String(stdout ?? ""),
stderr: String(stderr ?? ""),