mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-21 10:34:35 -07:00
chore(a2a-server): if a2a task creation fails return error to user (#8106)
Co-authored-by: cornmander <shikhman@google.com>
This commit is contained in:
@@ -7,14 +7,17 @@
|
||||
import { describe, it, expect, beforeAll, afterAll, vi } from 'vitest';
|
||||
import request from 'supertest';
|
||||
import type express from 'express';
|
||||
import { createApp, updateCoderAgentCardUrl } from './app.js';
|
||||
import * as fs from 'node:fs';
|
||||
import * as path from 'node:path';
|
||||
import * as os from 'node:os';
|
||||
import type { Server } from 'node:http';
|
||||
import type { TaskMetadata } from '../types.js';
|
||||
import type { AddressInfo } from 'node:net';
|
||||
|
||||
import { createApp, updateCoderAgentCardUrl } from './app.js';
|
||||
import type { TaskMetadata } from '../types.js';
|
||||
import { createMockConfig } from '../utils/testing_utils.js';
|
||||
import type { Config } from '@google/gemini-cli-core';
|
||||
|
||||
// Mock the logger to avoid polluting test output
|
||||
// Comment out to help debug
|
||||
vi.mock('../utils/logger.js', () => ({
|
||||
@@ -56,6 +59,16 @@ vi.mock('../agent/task.js', () => {
|
||||
return { Task: MockTask };
|
||||
});
|
||||
|
||||
vi.mock('../config/config.js', async () => {
|
||||
const actual = await vi.importActual('../config/config.js');
|
||||
return {
|
||||
...actual,
|
||||
loadConfig: vi
|
||||
.fn()
|
||||
.mockImplementation(async () => createMockConfig({}) as Config),
|
||||
};
|
||||
});
|
||||
|
||||
describe('Agent Server Endpoints', () => {
|
||||
let app: express.Express;
|
||||
let server: Server;
|
||||
|
||||
Reference in New Issue
Block a user