diff --git a/src/node-host/invoke-system-run.test.ts b/src/node-host/invoke-system-run.test.ts index 7ee2c2633f4..3389f88eef0 100644 --- a/src/node-host/invoke-system-run.test.ts +++ b/src/node-host/invoke-system-run.test.ts @@ -1430,29 +1430,25 @@ describe("handleSystemRunInvoke mac app exec host routing", () => { await withTempApprovalsHome({ approvals: createAllowlistOnMissApprovals(), run: async () => { + const tempDir = createFixtureDir("openclaw-inline-eval-bin-"); for (const testCase of cases) { - const tempDir = createFixtureDir("openclaw-inline-eval-bin-"); - try { - const executablePath = createTempExecutable({ - dir: tempDir, - name: testCase.executable, - }); - const { runCommand, sendInvokeResult } = await runSystemInvoke({ - preferMacAppExecHost: false, - command: [executablePath, ...testCase.args], - security: "allowlist", - ask: "on-miss", - approvalDecision: "allow-always", - approved: true, - runCommand: vi.fn(async () => createLocalRunResult("inline-eval-ok")), - }); + const executablePath = createTempExecutable({ + dir: tempDir, + name: testCase.executable, + }); + const { runCommand, sendInvokeResult } = await runSystemInvoke({ + preferMacAppExecHost: false, + command: [executablePath, ...testCase.args], + security: "allowlist", + ask: "on-miss", + approvalDecision: "allow-always", + approved: true, + runCommand: vi.fn(async () => createLocalRunResult("inline-eval-ok")), + }); - expect(runCommand).toHaveBeenCalledTimes(1); - expectInvokeOk(sendInvokeResult, { payloadContains: "inline-eval-ok" }); - expect(loadExecApprovals().agents?.main?.allowlist ?? []).toEqual([]); - } finally { - fs.rmSync(tempDir, { recursive: true, force: true }); - } + expect(runCommand).toHaveBeenCalledTimes(1); + expectInvokeOk(sendInvokeResult, { payloadContains: "inline-eval-ok" }); + expect(loadExecApprovals().agents?.main?.allowlist ?? []).toEqual([]); } }, });