From 63095bc6c0a385990ed0669d3e90ee00c8e26393 Mon Sep 17 00:00:00 2001 From: Amaad Martin Date: Sun, 2 Aug 2026 22:26:25 -0700 Subject: [PATCH] chore(test): drop the dead nodejs-vertexai mock from VertexAiSessionService tests The test file opened with a vi.mock('nodejs-vertexai', ...) factory and the comment "Mock the unreleased nodejs-vertexai package so the import resolves". No such package is declared in any package.json or the lockfile, nothing in the tree imports it, and the mocked SessionsClient symbol was referenced only by its own declaration inside that factory. The suite exercises the real @google-cloud/vertexai Sessions surface instead, so Vitest registered a factory for a specifier that is never resolved and the factory body never ran. The vi import stays: it is still used by vi.fn in the client stub, the fake timer helpers, and six vi.spyOn call sites. Test count is unchanged at 57 passing in 1 file. --- core/test/sessions/vertex_ai_session_service_test.ts | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/core/test/sessions/vertex_ai_session_service_test.ts b/core/test/sessions/vertex_ai_session_service_test.ts index c0e834607..98d7ec6c2 100644 --- a/core/test/sessions/vertex_ai_session_service_test.ts +++ b/core/test/sessions/vertex_ai_session_service_test.ts @@ -10,17 +10,6 @@ import {Session} from '@google/adk/sessions/session.js'; import {ApiError} from '@google/genai'; import {beforeEach, describe, expect, it, vi} from 'vitest'; -// Mock the unreleased nodejs-vertexai package so the import resolves -vi.mock('nodejs-vertexai', () => ({ - SessionsClient: class { - create = vi.fn(); - get = vi.fn(); - list = vi.fn(); - delete = vi.fn(); - events = {append: vi.fn()}; - }, -})); - import { isVertexAiConnectionString, quoteFilterLiteral,