// tools/generate-tests/test-helpers.ts — Shared helpers for generate-tests
// Extracted from generate-tests.ts to stay under 400-line limit
export function inferTestFramework(language, stack) {
    if (stack.includes('vitest')) {
        return 'vitest';
    }
    if (stack.includes('jest')) {
        return 'jest';
    }
    if (stack.includes('pytest')) {
        return 'pytest';
    }
    const defaults = {
        typescript: 'vitest',
        javascript: 'vitest',
        python: 'pytest',
        go: 'go-test',
        rust: 'cargo-test',
        java: 'junit',
        kotlin: 'junit',
        swift: 'xctest',
        dart: 'flutter-test',
    };
    return defaults[language] ?? 'vitest';
}
export function inferTestDir(language) {
    const dirs = {
        typescript: 'tests',
        javascript: 'tests',
        python: 'tests',
        go: 'tests',
        rust: 'tests',
        java: 'src/test',
        kotlin: 'src/test',
        swift: 'Tests',
        dart: 'test',
    };
    return dirs[language] ?? 'tests';
}
export function getTestExt(language) {
    const exts = {
        typescript: 'ts',
        javascript: 'js',
        python: 'py',
        go: 'go',
        rust: 'rs',
        java: 'java',
        kotlin: 'kt',
        swift: 'swift',
        dart: 'dart',
    };
    return exts[language] ?? 'ts';
}
export function generateUnitTestDefs(title, _target, testDir) {
    return [
        {
            name: `${title} — core logic`,
            type: 'unit',
            file: `${testDir}/unit/`,
            description: `Verify core business logic for ${title}`,
            priority: 'critical',
            automatable: true,
        },
        {
            name: `${title} — edge cases`,
            type: 'unit',
            file: `${testDir}/unit/`,
            description: `Test edge cases and error handling for ${title}`,
            priority: 'high',
            automatable: true,
        },
        {
            name: `${title} — validation`,
            type: 'unit',
            file: `${testDir}/unit/`,
            description: `Test input validation and sanitization`,
            priority: 'high',
            automatable: true,
        },
    ];
}
export function generateIntegrationTestDefs(title, target, testDir) {
    if (target !== 'backend' && target !== 'fullstack') {
        return [];
    }
    return [
        {
            name: `${title} — API integration`,
            type: 'integration',
            file: `${testDir}/integration/`,
            description: `Test API endpoints for ${title}`,
            priority: 'high',
            automatable: true,
        },
        {
            name: `${title} — database integration`,
            type: 'integration',
            file: `${testDir}/integration/`,
            description: `Test database operations for ${title}`,
            priority: 'medium',
            automatable: true,
        },
    ];
}
export function generateE2eTestDefs(title, target, testDir) {
    if (target !== 'frontend' && target !== 'fullstack') {
        return [];
    }
    return [
        {
            name: `${title} — user flow`,
            type: 'e2e',
            file: `${testDir}/e2e/`,
            description: `End-to-end test of user flow for ${title}`,
            priority: 'high',
            automatable: true,
        },
    ];
}
//# sourceMappingURL=test-helpers.js.map