anon-identity
Version:
Decentralized identity framework with DIDs, Verifiable Credentials, and privacy-preserving selective disclosure
123 lines • 2.75 kB
TypeScript
/**
* MCP Test Runner
*
* Centralized test execution and reporting for all Phase 5 MCP tests
*/
export interface TestSuite {
name: string;
description: string;
tests: TestCase[];
setup?: () => Promise<void>;
teardown?: () => Promise<void>;
}
export interface TestCase {
name: string;
description: string;
category: 'integration' | 'performance' | 'security' | 'multi-provider';
priority: 'high' | 'medium' | 'low';
timeout?: number;
retries?: number;
execute: () => Promise<TestResult>;
}
export interface TestResult {
passed: boolean;
duration: number;
error?: Error;
metrics?: Record<string, any>;
logs?: string[];
}
export interface TestRunReport {
totalTests: number;
passedTests: number;
failedTests: number;
skippedTests: number;
totalDuration: number;
coverage: TestCoverage;
suites: SuiteResult[];
}
export interface SuiteResult {
suite: string;
passed: number;
failed: number;
skipped: number;
duration: number;
results: TestCaseResult[];
}
export interface TestCaseResult {
name: string;
category: string;
priority: string;
status: 'passed' | 'failed' | 'skipped';
duration: number;
error?: string;
metrics?: Record<string, any>;
}
export interface TestCoverage {
integration: number;
performance: number;
security: number;
multiProvider: number;
overall: number;
}
/**
* MCP Test Runner
*/
export declare class MCPTestRunner {
private suites;
private results;
/**
* Add test suite
*/
addSuite(suite: TestSuite): void;
/**
* Run all test suites
*/
runAll(options?: {
categories?: string[];
priorities?: string[];
parallel?: boolean;
verbose?: boolean;
}): Promise<TestRunReport>;
/**
* Run specific test suite
*/
private runSuite;
/**
* Run individual test case
*/
private runTest;
/**
* Execute test with timeout and retries
*/
private executeWithTimeout;
/**
* Calculate test coverage
*/
private calculateCoverage;
/**
* Print test summary
*/
private printSummary;
/**
* Export results to file
*/
exportResults(format?: 'json' | 'xml' | 'html'): string;
/**
* Convert results to XML (JUnit format)
*/
private toXML;
/**
* Convert results to HTML report
*/
private toHTML;
/**
* Get test results
*/
getResults(): TestRunReport | null;
}
/**
* Example usage and demo test suites
*/
export declare function createDemoTestSuites(): TestSuite[];
export default MCPTestRunner;
//# sourceMappingURL=mcp-test-runner.d.ts.map