@ordojs/core
Version:
Core compiler and runtime for OrdoJS framework
87 lines • 2.76 kB
TypeScript
/**
* @fileoverview OrdoJS Test Framework - Main testing class
*/
import { type CompilerOptions } from '../compiler/index.js';
import { ComponentTestUtils } from './component-utils.js';
import { ReactiveTestUtils } from './reactive-utils.js';
import { ServerMockUtils } from './server-mock.js';
import { SnapshotTester } from './snapshot-tester.js';
import type { CompilationTestCase, ComponentTestResult, PerformanceMetrics, TestComponentOptions, TestEnvironment, TestSuiteConfig } from './types.js';
/**
* Main OrdoJS testing framework class
*/
export declare class OrdoJSTestFramework {
private reactiveUtils;
private serverMockUtils;
private snapshotTester;
private componentUtils;
private currentEnvironment?;
private jsdomInstance?;
constructor();
/**
* Set up test environment
*/
setupEnvironment(environment: TestEnvironment): Promise<void>;
/**
* Clean up test environment
*/
teardownEnvironment(): Promise<void>;
/**
* Compile OrdoJS source code for testing
*/
compileForTesting(source: string, options?: CompilerOptions): Promise<ComponentTestResult>;
/**
* Test component compilation and rendering
*/
testComponent(source: string, options?: TestComponentOptions): Promise<ComponentTestResult>;
/**
* Test reactive behavior
*/
testReactivity(source: string, testCases: Array<{
name: string;
initialState: Record<string, any>;
actions: Array<{
type: string;
variable?: string;
value?: any;
}>;
expectedState: Record<string, any>;
}>): Promise<ComponentTestResult[]>;
/**
* Test compilation with multiple test cases
*/
testCompilation(testCases: CompilationTestCase[]): Promise<ComponentTestResult[]>;
/**
* Test generated code snapshots
*/
testSnapshots(testCases: Array<{
name: string;
source: string;
updateSnapshots?: boolean;
}>): Promise<ComponentTestResult[]>;
/**
* Measure performance metrics
*/
measurePerformance(source: string, iterations?: number): Promise<PerformanceMetrics>;
/**
* Run a complete test suite
*/
runTestSuite(config: TestSuiteConfig, tests: (() => Promise<void>)[]): Promise<void>;
/**
* Get reactive testing utilities
*/
getReactiveUtils(): ReactiveTestUtils;
/**
* Get server mocking utilities
*/
getServerMockUtils(): ServerMockUtils;
/**
* Get snapshot testing utilities
*/
getSnapshotTester(): SnapshotTester;
/**
* Get component testing utilities
*/
getComponentUtils(): ComponentTestUtils;
}
//# sourceMappingURL=test-framework.d.ts.map