From 6d32406690a648d1e79827643251012fbc6f6d3f Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Sun, 12 Apr 2026 10:17:34 +0100 Subject: [PATCH] test(pi): type runtime api key auth mock --- src/agents/pi-embedded-runner/run/auth-controller.test.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/agents/pi-embedded-runner/run/auth-controller.test.ts b/src/agents/pi-embedded-runner/run/auth-controller.test.ts index 8b54fbcfe39..b2e03525e34 100644 --- a/src/agents/pi-embedded-runner/run/auth-controller.test.ts +++ b/src/agents/pi-embedded-runner/run/auth-controller.test.ts @@ -1,5 +1,5 @@ import type { Api, Model } from "@mariozechner/pi-ai"; -import { beforeEach, describe, expect, it, vi } from "vitest"; +import { beforeEach, describe, expect, it, vi, type Mock } from "vitest"; import type { AuthProfileStore } from "../../auth-profiles.js"; import type { RuntimeAuthState } from "./helpers.js"; @@ -71,6 +71,8 @@ type MutableAuthControllerHarness = { profileIndex: number; }; +type RuntimeApiKeySetter = Mock<(provider: string, apiKey: string) => void>; + function createMutableAuthControllerHarness(): MutableAuthControllerHarness { return { runtimeModel: createTestModel(), @@ -84,7 +86,7 @@ function createMutableAuthControllerHarness(): MutableAuthControllerHarness { function createMutableEmbeddedRunAuthController(params: { harness: MutableAuthControllerHarness; - setRuntimeApiKey: ReturnType; + setRuntimeApiKey: RuntimeApiKeySetter; profileCandidates?: string[]; }) { return createEmbeddedRunAuthController({