test(core): give the telemetry-swap client mock a getToolRegistry (#10220)

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.
This commit is contained in:
Shaojin Wen authored and GitHub committed 2026-08-27 02:03:46 +00:00
1 parent fc0e827658
commit 8241905392
1 file changed
+5
@@ -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 = {