diff --git a/src/agents/bash-tools.exec.script-preflight.test.ts b/src/agents/bash-tools.exec.script-preflight.test.ts index 5518bb3fe03..de6426bacfc 100644 --- a/src/agents/bash-tools.exec.script-preflight.test.ts +++ b/src/agents/bash-tools.exec.script-preflight.test.ts @@ -1,11 +1,25 @@ import { constants as fsConstants } from "node:fs"; import fs from "node:fs/promises"; import path from "node:path"; -import { afterEach, describe, expect, it } from "vitest"; +import { afterEach, describe, expect, it, vi } from "vitest"; import { __setFsSafeTestHooksForTest } from "../infra/fs-safe.js"; import { withTempDir } from "../test-utils/temp-dir.js"; import { __testing, createExecTool } from "./bash-tools.exec.js"; +vi.mock("./bash-tools.exec-host-gateway.js", () => ({ + processGatewayAllowlist: async () => ({ allowWithoutEnforcedCommand: true }), +})); + +vi.mock("./bash-tools.exec-host-node.js", () => ({ + executeNodeHostCommand: async () => { + throw new Error("node host execution is not used by script preflight tests"); + }, +})); + +vi.mock("../utils/delivery-context.js", () => ({ + normalizeDeliveryContext: (value: unknown) => value, +})); + const isWin = process.platform === "win32"; const describeNonWin = isWin ? describe.skip : describe;