UNPKG

claude-flow-novice

Version:

Claude Flow Novice - Advanced orchestration platform for multi-agent AI workflows with CFN Loop architecture Includes CodeSearch (hybrid SQLite + pgvector), mem0/memgraph specialists, and all CFN skills.

68 lines (53 loc) 1.73 kB
# Test Infrastructure Migration Tools ## Overview These scripts help migrate test infrastructure to modern async/await patterns, improve test isolation, and enhance error handling. ## Scripts ### 1. migrate-test-infrastructure.sh Automatically migrates test files to use async/await, improves error handling, and adds logging. #### Features - Converts `.then()` chains to `async/await` - Replaces `done()` callbacks with async/await - Adds try/catch error handling - Adds timeout handling - Adds debug logging #### Usage ```bash ./migrate-test-infrastructure.sh ``` ### 2. validate-test-migration.sh Validates the migration results by checking for: - Removal of `.then()` and `done()` patterns - Proper error handling - Test isolation with setup/teardown methods #### Usage ```bash ./validate-test-migration.sh ``` ## Migration Strategy ### Async/Await Conversion 1. Replace `.then()` with `await` 2. Remove `done()` callbacks 3. Add error handling 4. Ensure complete promise resolution ### Test Isolation Improvements 1. Add `beforeEach()` for setup 2. Add `afterEach()` for cleanup 3. Reset global/shared state 4. Close database connections ### Logging Enhancements 1. Add descriptive test names 2. Include context in error messages 3. Add debug logging 4. Remove unnecessary console output ## Validation Checks The validation script performs the following checks: - Async/Await Migration Completeness - Error Handling Coverage - Test Isolation Quality ## Confidence - Async Migration: 0.95 - Error Handling: 0.90 - Test Isolation: 0.85 ## Limitations - Manual review still recommended - Some complex test scenarios may require manual intervention