From 168c65aa26b16842eacfec908ff0432c468747b5 Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Sat, 7 Mar 2026 16:09:57 -0800 Subject: [PATCH] Allowlists: type test runtime mocks --- src/channels/allowlists/resolve-utils.test.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/channels/allowlists/resolve-utils.test.ts b/src/channels/allowlists/resolve-utils.test.ts index 8702fbd46a7..5c67f27e350 100644 --- a/src/channels/allowlists/resolve-utils.test.ts +++ b/src/channels/allowlists/resolve-utils.test.ts @@ -1,4 +1,5 @@ import { describe, expect, it, vi } from "vitest"; +import type { RuntimeEnv } from "../../runtime.js"; import { addAllowlistUserEntriesFromConfigEntry, buildAllowlistResolutionSummary, @@ -98,7 +99,11 @@ describe("patchAllowlistUsersInConfigEntries", () => { describe("summarizeMapping", () => { it("logs sampled resolved and unresolved entries", () => { - const runtime = { log: vi.fn() }; + const runtime: RuntimeEnv = { + log: vi.fn(), + error: vi.fn(), + exit: vi.fn(), + }; summarizeMapping("discord allowlist", ["a", "b", "c", "d", "e", "f", "g"], ["x", "y"], runtime); @@ -108,7 +113,11 @@ describe("summarizeMapping", () => { }); it("skips logging when both lists are empty", () => { - const runtime = { log: vi.fn() }; + const runtime: RuntimeEnv = { + log: vi.fn(), + error: vi.fn(), + exit: vi.fn(), + }; summarizeMapping("discord allowlist", [], [], runtime);