@ai-capabilities-suite/mcp-debugger-core
Version:
Core debugging engine for Node.js and TypeScript applications. Provides Inspector Protocol integration, breakpoint management, variable inspection, execution control, profiling, hang detection, and source map support.
66 lines (65 loc) • 1.68 kB
TypeScript
/**
* Test result for a single test case
*/
export interface TestCase {
name: string;
status: 'passed' | 'failed' | 'skipped';
duration?: number;
failureMessage?: string;
failureStack?: string;
}
/**
* Test suite result
*/
export interface TestSuite {
name: string;
tests: TestCase[];
duration?: number;
}
/**
* Complete test execution result
*/
export interface TestExecutionResult {
framework: 'jest' | 'mocha' | 'vitest';
success: boolean;
exitCode: number | null;
suites: TestSuite[];
stdout: string;
stderr: string;
totalTests: number;
passedTests: number;
failedTests: number;
skippedTests: number;
duration?: number;
wsUrl?: string;
}
/**
* Configuration for test execution
*/
export interface TestExecutionConfig {
framework: 'jest' | 'mocha' | 'vitest';
testFile?: string;
args?: string[];
cwd?: string;
timeout?: number;
attachInspector?: boolean;
}
/**
* Parse Jest JSON output
*/
export declare function parseJestOutput(stdout: string, stderr: string): Partial<TestExecutionResult>;
/**
* Parse Mocha output
*/
export declare function parseMochaOutput(stdout: string, stderr: string): Partial<TestExecutionResult>;
/**
* Parse Vitest output
*/
export declare function parseVitestOutput(stdout: string, stderr: string): Partial<TestExecutionResult>;
/**
* Execute tests with a test framework
* Spawns the test runner with inspector attached if requested
* Captures stdout/stderr and parses test results
* Requirements: 6.1, 6.2, 6.3, 6.4, 6.5
*/
export declare function executeTests(config: TestExecutionConfig): Promise<TestExecutionResult>;