chore(tsgo/format): fix CI errors

This commit is contained in:
Gustavo Madeira Santana
2026-02-21 17:51:56 -05:00
parent 6ac89757ba
commit 0e1aa77928
15 changed files with 133 additions and 59 deletions

View File

@@ -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 ?? []);