perf(test): slim exec preflight imports

This commit is contained in:
Peter Steinberger
2026-04-23 15:04:00 +01:00
parent be4920f9bc
commit 63a88ff1df

View File

@@ -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;