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