@jbcom/vitest-agentic
Vitest plugin with fixtures and utilities for agentic-control E2E testing.
This package provides test utilities and mocking fixtures for building E2E tests with agentic-control components (MCP, providers, sandbox, fleet).
Examples
Section titled “Examples”pnpm add -D vitest-agentic-controlimport { describe, it, expect } from 'vitest';import { createMcpMocker, createProviderMocker } from 'vitest-agentic-control';
describe('My MCP Tests', () => { it('should mock MCP server', async () => { const mocker = createMcpMocker(); mocker.mockServer('test-server', { tools: [{ name: 'test-tool', handler: () => ({ result: 'ok' }) }], });
// Your test code here });});import { createProviderMocker } from 'vitest-agentic-control';
const mocker = createProviderMocker();mocker.mockAnthropic({ response: 'Mocked Claude response' });mocker.mockOpenAI({ response: 'Mocked GPT response' });Available exports:
AgenticMocker- Main mocker class for comprehensive mockingcreateMcpMocker- Factory for MCP server mockingcreateProviderMocker- Factory for AI provider mockingcreateSandboxMocker- Factory for sandbox execution mocking- Test fixtures for configs and environment setup
Classes
Section titled “Classes”Interfaces
Section titled “Interfaces”- McpMockerOptions
- MockContainerConfig
- MockExecutionResult
- MockMcpResource
- MockMcpTool
- MockProviderResponse
- MockResourceDefinition
- MockStreamChunk
- MockToolDefinition
- ProviderMockerOptions
- SandboxMockerOptions
- TestConfig
- TestConfigOptions
- TestEnvSetup
- TestFleetConfig
- TestSandboxConfig
- TestTokenConfig
- TestTriageConfig