Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion packages/core/src/agents/generalist-agent.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,22 @@
* SPDX-License-Identifier: Apache-2.0
*/

import { describe, it, expect, vi } from 'vitest';
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
import { GeneralistAgent } from './generalist-agent.js';
import { makeFakeConfig } from '../test-utils/config.js';
import type { ToolRegistry } from '../tools/tool-registry.js';
import type { AgentRegistry } from './registry.js';

describe('GeneralistAgent', () => {
beforeEach(() => {
vi.stubEnv('GEMINI_SYSTEM_MD', '');
vi.stubEnv('GEMINI_WRITE_SYSTEM_MD', '');
});

afterEach(() => {
vi.unstubAllEnvs();
});

it('should create a valid generalist agent definition', () => {
const config = makeFakeConfig();
vi.spyOn(config, 'getToolRegistry').mockReturnValue({
Expand Down
9 changes: 8 additions & 1 deletion packages/core/src/prompts/promptProvider.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import { describe, it, expect, vi, beforeEach } from 'vitest';
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
import { PromptProvider } from './promptProvider.js';
import type { Config } from '../config/config.js';
import {
Expand Down Expand Up @@ -35,6 +35,9 @@ describe('PromptProvider', () => {

beforeEach(() => {
vi.resetAllMocks();
vi.stubEnv('GEMINI_SYSTEM_MD', '');
vi.stubEnv('GEMINI_WRITE_SYSTEM_MD', '');

mockConfig = {
getToolRegistry: vi.fn().mockReturnValue({
getAllToolNames: vi.fn().mockReturnValue([]),
Expand All @@ -60,6 +63,10 @@ describe('PromptProvider', () => {
} as unknown as Config;
});

afterEach(() => {
vi.unstubAllEnvs();
});

it('should handle multiple context filenames in the system prompt', () => {
vi.mocked(getAllGeminiMdFilenames).mockReturnValue([
DEFAULT_CONTEXT_FILENAME,
Expand Down
Loading