mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-25 14:25:02 +00:00
Add AST-based migration framework for converting TypeScript tests to JSON: New files: - scripts/migrate-tests/converter.ts (350+ lines) * AST parser for .test.ts files * Extracts describe/it/expect blocks * Maps 30+ Jest/Vitest matchers to JSON types * Returns structured ConversionResult - scripts/migrate-tests/migrator.ts (250+ lines) * Batch discovery and migration orchestrator * Glob-based .test.ts file discovery * Automatic output directory creation * Dry-run mode for safe preview * Pretty-printed progress reporting * Package name mapping (frontends → packages) - scripts/migrate-tests/validator.ts (300+ lines) * JSON schema validation using AJV * Semantic checks (unique IDs, assertions) * Unused import warnings * Directory-wide validation support * Structured ValidationResult output - scripts/migrate-tests/index.ts * Unified export module - scripts/migrate-tests/README.md * Comprehensive usage guide * Conversion process documentation * Matcher mapping reference * Workflow recommendations * Troubleshooting guide Features: * 80/20 conversion (handles ~80% of tests cleanly) * Fallback for complex tests requiring manual adjustment * Dry-run mode to preview changes * Verbose logging for troubleshooting * Validates against tests_schema.json Matcher Support: * Basic: equals, deepEquals, notEquals, truthy, falsy * Numeric: greaterThan, lessThan, greaterThanOrEqual, lessThanOrEqual * Type: null, notNull, undefined, notUndefined, instanceOf * Collection: contains, matches, hasProperty, hasLength * DOM: toBeVisible, toBeInTheDocument, toHaveTextContent, toHaveAttribute, toHaveClass, toBeDisabled, toBeEnabled, toHaveValue * Control: throws, notThrows, custom This completes Phase 3 Task 4 of the JSON interpreter everywhere implementation. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
13 lines
400 B
TypeScript
13 lines
400 B
TypeScript
/**
|
|
* Test Migration Toolkit
|
|
* Exports for batch test migration operations
|
|
*/
|
|
|
|
export { TestConverter, ConversionResult } from './converter';
|
|
export { TestMigrator, MigrationConfig } from './migrator';
|
|
export { TestValidator, ValidationResult } from './validator';
|
|
|
|
export { convertFile } from './converter';
|
|
export { runMigration } from './migrator';
|
|
export { validateTests } from './validator';
|