Files
metabuilder/tools/refactoring/auto-code-extractor-3000/functions/run-tests.ts
T

27 lines
931 B
TypeScript

import { ASTLambdaRefactor } from './ast-lambda-refactor'
import * as fs from 'fs/promises'
import * as path from 'path'
import { findLargeFiles } from './reporting/find-large-files'
import { generateProgressReport } from './reporting/generate-progress-report'
import { runCommand } from './cli/utils/run-command'
export async function runTests(): Promise<boolean> {
if (this.options.skipTest || this.options.dryRun) {
return true
}
console.log('\n' + '='.repeat(70))
console.log('PHASE 3: TESTING')
console.log('='.repeat(70) + '\n')
try {
this.log('Running unit tests...', 'info')
await runCommand('npm test -- --run', { ignoreError: true })
this.log('Tests completed', 'success')
return true
} catch (error) {
this.log('Some tests may need updates (this is normal)', 'warning')
return true // Don't fail on test errors
}
}