feat(core): Implement Protocol V2 with enhanced settings and lifecycle hooks
This commit is contained in:
		
							
								
								
									
										46
									
								
								ts_tapbundle/tapbundle.interfaces.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										46
									
								
								ts_tapbundle/tapbundle.interfaces.ts
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,46 @@ | ||||
| export interface ITapSettings { | ||||
|   // Timing | ||||
|   timeout?: number;              // Default timeout for all tests (ms) | ||||
|   slowThreshold?: number;        // Mark tests as slow if they exceed this (ms) | ||||
|    | ||||
|   // Execution Control | ||||
|   bail?: boolean;                // Stop on first test failure | ||||
|   retries?: number;              // Number of retries for failed tests | ||||
|   retryDelay?: number;           // Delay between retries (ms) | ||||
|    | ||||
|   // Output Control | ||||
|   suppressConsole?: boolean;     // Suppress console output in passing tests | ||||
|   verboseErrors?: boolean;       // Show full stack traces | ||||
|   showTestDuration?: boolean;    // Show duration for each test | ||||
|    | ||||
|   // Parallel Execution | ||||
|   maxConcurrency?: number;       // Max parallel tests (for .para files) | ||||
|   isolateTests?: boolean;        // Run each test in fresh context | ||||
|    | ||||
|   // Lifecycle Hooks | ||||
|   beforeAll?: () => Promise<void> | void; | ||||
|   afterAll?: () => Promise<void> | void; | ||||
|   beforeEach?: (testName: string) => Promise<void> | void; | ||||
|   afterEach?: (testName: string, passed: boolean) => Promise<void> | void; | ||||
|    | ||||
|   // Environment | ||||
|   env?: Record<string, string>;  // Additional environment variables | ||||
|    | ||||
|   // Features | ||||
|   enableSnapshots?: boolean;     // Enable snapshot testing | ||||
|   snapshotDirectory?: string;    // Custom snapshot directory | ||||
|   updateSnapshots?: boolean;     // Update snapshots instead of comparing | ||||
| } | ||||
|  | ||||
| export interface ISettingsManager { | ||||
|   // Get merged settings for current context | ||||
|   getSettings(): ITapSettings; | ||||
|    | ||||
|   // Apply settings at different levels | ||||
|   setGlobalSettings(settings: ITapSettings): void; | ||||
|   setFileSettings(settings: ITapSettings): void; | ||||
|   setTestSettings(testId: string, settings: ITapSettings): void; | ||||
|    | ||||
|   // Get settings for specific test | ||||
|   getTestSettings(testId: string): ITapSettings; | ||||
| } | ||||
		Reference in New Issue
	
	Block a user