@ordojs/core
Version:
Core compiler and runtime for OrdoJS framework
71 lines • 2.18 kB
TypeScript
/**
* @fileoverview Reactive Testing Utilities
*/
import type { DOMUpdateExpectation, DOMUpdateRecord, ReactiveAction, ReactiveTestCase } from './types.js';
/**
* Utilities for testing reactive behavior
*/
export declare class ReactiveTestUtils {
private domUpdateRecords;
private stateChangeListeners;
/**
* Execute a reactive action on a component instance
*/
executeAction(componentInstance: any, action: ReactiveAction): Promise<void>;
/**
* Simulate DOM event
*/
private simulateEvent;
/**
* Wait for async state updates to complete
*/
private waitForStateUpdates;
/**
* Record DOM update for testing
*/
private recordDOMUpdate;
/**
* Compare two state objects
*/
compareStates(actual: Record<string, any>, expected: Record<string, any>): boolean;
/**
* Deep equality check
*/
private deepEqual;
/**
* Verify DOM updates match expectations
*/
verifyDOMUpdates(expectations: DOMUpdateExpectation[]): boolean;
/**
* Get recorded DOM updates
*/
getDOMUpdateRecords(): DOMUpdateRecord[];
/**
* Clear DOM update records
*/
clearDOMUpdateRecords(): void;
/**
* Create a reactive test case
*/
createTestCase(name: string, initialState: Record<string, any>, actions: ReactiveAction[], expectedState: Record<string, any>, expectedDOMUpdates?: DOMUpdateExpectation[]): ReactiveTestCase;
/**
* Run a reactive test case
*/
runTestCase(componentInstance: any, testCase: ReactiveTestCase): Promise<{
success: boolean;
errors: string[];
}>;
/**
* Batch multiple reactive actions
*/
executeBatchedActions(componentInstance: any, actions: ReactiveAction[]): Promise<void>;
/**
* Test reactive dependency tracking
*/
testDependencyTracking(componentInstance: any, variable: string, expectedDependents: string[]): boolean;
/**
* Test circular dependency detection
*/
testCircularDependencyDetection(componentInstance: any, expectedCircularDeps: string[][]): boolean;
}
//# sourceMappingURL=reactive-utils.d.ts.map