mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 04:01:23 +00:00
chore(tsgo/format): fix CI errors
This commit is contained in:
@@ -24,6 +24,7 @@ import {
|
||||
resolveExecApprovalsSocketPath,
|
||||
resolveSafeBins,
|
||||
type ExecAllowlistEntry,
|
||||
type ExecApprovalsAgent,
|
||||
type ExecApprovalsFile,
|
||||
} from "./exec-approvals.js";
|
||||
import { SAFE_BIN_PROFILE_FIXTURES, SAFE_BIN_PROFILES } from "./exec-safe-bin-policy.js";
|
||||
@@ -204,7 +205,7 @@ describe("exec approvals command resolution", () => {
|
||||
return {
|
||||
command: "./scripts/run.sh --flag",
|
||||
cwd,
|
||||
envPath: undefined as string | undefined,
|
||||
envPath: undefined as NodeJS.ProcessEnv | undefined,
|
||||
expectedPath: script,
|
||||
expectedExecutableName: undefined,
|
||||
};
|
||||
@@ -222,7 +223,7 @@ describe("exec approvals command resolution", () => {
|
||||
return {
|
||||
command: '"./bin/tool" --version',
|
||||
cwd,
|
||||
envPath: undefined as string | undefined,
|
||||
envPath: undefined as NodeJS.ProcessEnv | undefined,
|
||||
expectedPath: script,
|
||||
expectedExecutableName: undefined,
|
||||
};
|
||||
@@ -258,7 +259,7 @@ describe("exec approvals shell parsing", () => {
|
||||
for (const testCase of cases) {
|
||||
const res = analyzeShellCommand({ command: testCase.command });
|
||||
expect(res.ok, testCase.name).toBe(true);
|
||||
if (testCase.expectedSegments) {
|
||||
if ("expectedSegments" in testCase) {
|
||||
expect(
|
||||
res.segments.map((seg) => seg.argv[0]),
|
||||
testCase.name,
|
||||
@@ -1197,7 +1198,7 @@ describe("normalizeExecApprovals handles string allowlist entries (#9790)", () =
|
||||
const patterns = getMainAllowlistPatterns({
|
||||
version: 1,
|
||||
agents: {
|
||||
main: { allowlist: testCase.allowlist } as ExecApprovalsFile["agents"]["main"],
|
||||
main: { allowlist: testCase.allowlist } as ExecApprovalsAgent,
|
||||
},
|
||||
});
|
||||
expect(patterns, testCase.name).toEqual(testCase.expectedPatterns);
|
||||
@@ -1205,7 +1206,7 @@ describe("normalizeExecApprovals handles string allowlist entries (#9790)", () =
|
||||
const entries = normalizeExecApprovals({
|
||||
version: 1,
|
||||
agents: {
|
||||
main: { allowlist: testCase.allowlist } as ExecApprovalsFile["agents"]["main"],
|
||||
main: { allowlist: testCase.allowlist } as ExecApprovalsAgent,
|
||||
},
|
||||
}).agents?.main?.allowlist;
|
||||
expectNoSpreadStringArtifacts(entries ?? []);
|
||||
|
||||
Reference in New Issue
Block a user