test: use absolute exec path for allowlist

This commit is contained in:
Peter Steinberger
2026-01-22 09:20:38 +00:00
parent 4c8806ad38
commit 646ea6ef0b

View File

@@ -80,10 +80,6 @@ describe("exec approvals", () => {
if (process.platform !== "win32") {
await fs.chmod(exePath, 0o755);
}
const execEnv: Record<string, string> = { PATH: binDir };
if (process.platform === "win32") {
execEnv.PATHEXT = ".CMD";
}
const approvalsFile = {
version: 1,
defaults: { security: "allowlist", ask: "on-miss", askFallback: "deny" },
@@ -117,8 +113,7 @@ describe("exec approvals", () => {
});
const result = await tool.execute("call2", {
command: `${exeName} --help`,
env: execEnv,
command: `"${exePath}" --help`,
});
expect(result.details.status).toBe("completed");
expect(calls).toContain("exec.approvals.node.get");