From 5a19681b4ecc330be63b0aae26315adec81aa4e1 Mon Sep 17 00:00:00 2001 From: wenshao Date: Thu, 27 Aug 2026 09:16:14 +0800 Subject: [PATCH] test(core): give the telemetry-swap client mock a getToolRegistry MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GeminiClient.initialize() now calls restoreLoadedSkillsFromHistory, which resolves the SKILL tool through this.config.getToolRegistry(). The telemetry- swap transaction tests build a minimal config mock that predates that call and does not provide getToolRegistry, so every test that awaits client.initialize() throws "this.config.getToolRegistry is not a function" and the file reds the Linux unit lane. Add getToolRegistry to the mock, returning an empty registry (no SKILL tool, so the skill restore is a no-op) — the transaction behaviour under test is unchanged. --- packages/core/src/core/client.telemetrySwap.test.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/core/src/core/client.telemetrySwap.test.ts b/packages/core/src/core/client.telemetrySwap.test.ts index 4712bd468c4..2a19bc70754 100644 --- a/packages/core/src/core/client.telemetrySwap.test.ts +++ b/packages/core/src/core/client.telemetrySwap.test.ts @@ -93,6 +93,11 @@ function makeEnv() { sessionId = id; resumedData = data; }, + // `initialize()` calls restoreLoadedSkillsFromHistory, which resolves the + // SKILL tool through the registry; this mock only exercises the telemetry + // swap, so return an empty registry (no SKILL tool → the restore is a + // no-op) rather than let the call throw `getToolRegistry is not a function`. + getToolRegistry: () => ({ getTool: () => undefined }), }; const client = new GeminiClient(config as Config); const fakeChat = {