From 63a88ff1dfb2917e89da2f790d26272ff36e01ad Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Thu, 23 Apr 2026 15:04:00 +0100 Subject: [PATCH] perf(test): slim exec preflight imports --- .../bash-tools.exec.script-preflight.test.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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;