fix: mock api-logger and api-logging.plugin in cloudHandler-sync test

The DailyRotateFile transport in api-logger.ts creates directories at
module load time. When the paths mock returns '/mock/agent/dir', the
real file-stream-rotator fails with EACCES on CI Linux runners.

Added vi.mock for both api-logger and api-logging.plugin to prevent
the real DailyRotateFile from initializing during tests.
This commit is contained in:
Gemini Nexus Bot committed 2026-04-29 03:00:54 -03:00
1 parent 6e568dd866
commit cca8bdf68f
1 file changed
+14
+14
View File
@@ -85,6 +85,20 @@ vi.mock('../../utils/traffic-logger', () => ({
},
}));
vi.mock('../../server/logging/api-logger', () => ({
apiLogger: {
info: vi.fn(),
warn: vi.fn(),
error: vi.fn(),
debug: vi.fn(),
},
safeApiLogValue: vi.fn((v: unknown) => v),
}));
vi.mock('../../server/logging/api-logging.plugin', () => ({
registerApiLogging: vi.fn(),
}));
vi.mock('../../services/GoogleAPIService', () => ({
GoogleAPIService: {
getUserInfo: vi.fn(),