mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 07:00:43 +00:00
perf(test): slim exec preflight imports
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user