test: tighten acp security helpers

This commit is contained in:
Peter Steinberger
2026-05-08 21:17:59 +01:00
parent d7f4c8b437
commit daa48e8681
4 changed files with 3 additions and 4 deletions

View File

@@ -113,7 +113,9 @@ async function createHarness(
const promptPromise = promptAgent(agent, SESSION_ID);
await vi.waitFor(() => {
expect(runId).toBeDefined();
if (!runId) {
throw new Error("expected ACP permission relay run id");
}
});
return {

View File

@@ -27,7 +27,6 @@ function requireFinding(
label: string,
) {
const finding = findings.find((entry) => entry.checkId === checkId);
expect(finding, label).toBeDefined();
if (!finding) {
throw new Error(`Expected ${checkId} finding for ${label}`);
}

View File

@@ -123,7 +123,6 @@ describe("security fix", () => {
const whatsapp = channels.whatsapp;
const accounts = whatsapp.accounts as Record<string, Record<string, unknown>>;
const account = accounts[accountId];
expect(account).toBeDefined();
if (!account) {
throw new Error(`Expected WhatsApp account ${accountId}`);
}

View File

@@ -88,7 +88,6 @@ function expectInspectSuccess(
function expectIcaclsResetCommand(
result: ReturnType<typeof createIcaclsResetCommand>,
): NonNullable<ReturnType<typeof createIcaclsResetCommand>> {
expect(result).toBeDefined();
if (!result) {
throw new Error("Expected icacls reset command");
}