UNPKG

supa-seed

Version:

A constraint-aware, framework-agnostic database seeding framework with deep PostgreSQL business logic discovery and MakerKit integration support

169 lines 4.4 kB
/** * Architecture Test Suite * Tests the new schema-first architecture against multiple MakerKit variants and custom schemas * Validates that the beta tester's concerns have been addressed */ export interface TestScenario { name: string; description: string; mockSchema: MockSchema; testConfig: any; expectedBehavior: { shouldSucceed: boolean; frameworkDetection: string; primaryUserTable: string; constraintsHandled: number; fallbacksUsed?: string[]; }; validationCriteria: ValidationCriteria; } export interface MockSchema { tables: MockTable[]; relationships: MockRelationship[]; constraints: MockConstraint[]; framework: { type: string; version: string; evidence: string[]; }; } export interface MockTable { name: string; columns: MockColumn[]; hasData: boolean; recordCount: number; } export interface MockColumn { name: string; type: string; nullable: boolean; isPrimaryKey: boolean; isForeignKey: boolean; defaultValue?: any; } export interface MockRelationship { fromTable: string; fromColumn: string; toTable: string; toColumn: string; cascadeDelete: boolean; required: boolean; } export interface MockConstraint { name: string; type: string; table: string; columns: string[]; checkDefinition?: string; referencedTable?: string; } export interface ValidationCriteria { mustDetectFramework: boolean; mustHandleConstraints: boolean; mustRespectRelationships: boolean; mustGenerateWorkflow: boolean; mustPreventErrors: boolean; maxExecutionTime: number; minConfidenceScore: number; } export interface TestResult { scenario: string; success: boolean; actualBehavior: { frameworkDetected: string; primaryUserTable: string; constraintsHandled: number; executionTime: number; confidenceScore: number; fallbacksUsed: string[]; workflowSteps: number; }; validationResults: { frameworkDetection: boolean; constraintHandling: boolean; relationshipRespect: boolean; workflowGeneration: boolean; errorPrevention: boolean; performanceTest: boolean; confidenceTest: boolean; }; errors: string[]; warnings: string[]; details: string; } export interface TestSuiteResult { totalScenarios: number; passedScenarios: number; failedScenarios: number; results: TestResult[]; summary: { frameworkDetectionAccuracy: number; constraintHandlingSuccess: number; overallSuccess: number; averageExecutionTime: number; averageConfidence: number; }; recommendations: string[]; } export declare class ArchitectureTestSuite { private mockClient; private scenarios; constructor(); /** * Run the complete test suite */ runTestSuite(): Promise<TestSuiteResult>; /** * Run a specific test scenario */ runScenario(scenario: TestScenario): Promise<TestResult>; /** * Setup test scenarios for different MakerKit variants and custom schemas */ private setupTestScenarios; /** * Setup mock Supabase client */ private setupMockClient; /** * Configure mock schema for a test scenario */ private configureMockSchema; /** * Validate scenario results against criteria */ private validateScenarioResults; /** * Calculate framework detection accuracy across all tests */ private calculateFrameworkAccuracy; /** * Calculate constraint handling success rate */ private calculateConstraintSuccess; /** * Generate recommendations based on test results */ private generateRecommendations; /** * Generate detailed test information */ private generateTestDetails; /** * Create error result for failed scenarios */ private createErrorResult; /** * Log test suite results */ private logTestSuiteResult; /** * Run a specific test by name */ runSingleTest(scenarioName: string): Promise<TestResult | null>; /** * Get list of available test scenarios */ getAvailableScenarios(): string[]; } //# sourceMappingURL=architecture-test-suite.d.ts.map