"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const test_anticipator_1 = require("../test-anticipator");
describe('TestAnticipator', () => {
    let anticipator;
    beforeEach(() => {
        anticipator = new test_anticipator_1.TestAnticipator();
    });
    test('analyzes simple function', () => {
        const result = anticipator.analyzeFunction('function add(a: number, b: number): number { return a + b; }');
        expect(result.name).toBe('add');
        expect(result.params).toEqual(['a: number', 'b: number']);
        expect(result.returnType).toBe('number');
        expect(result.isAsync).toBe(false);
    });
    test('analyzes async arrow function', () => {
        const result = anticipator.analyzeFunction('const fetchData = async (url: string): Promise<Data> => { ... }');
        expect(result.name).toBe('fetchData');
        expect(result.isAsync).toBe(true);
    });
    test('generates tests for function with params', () => {
        const tests = anticipator.generateTests('function greet(name: string): string { return `Hello ${name}`; }');
        expect(tests.length).toBeGreaterThan(0);
        expect(tests.some((t) => t.type === 'happy')).toBe(true);
        expect(tests.some((t) => t.type === 'error')).toBe(true);
        expect(tests.some((t) => t.type === 'edge')).toBe(true);
    });
    test('generates tests for async function', () => {
        const tests = anticipator.generateTests('async function fetchUser(id: string): Promise<User> { ... }');
        expect(tests.some((t) => t.type === 'error')).toBe(true);
    });
    test('generates tests for array return type', () => {
        const tests = anticipator.generateTests('function getUsers(): User[] { return []; }');
        expect(tests.some((t) => t.name.includes('empty array'))).toBe(true);
    });
    test('generates tests for string return type', () => {
        const tests = anticipator.generateTests('function getName(): string { return ""; }');
        expect(tests.some((t) => t.name.includes('empty string'))).toBe(true);
    });
});
//# sourceMappingURL=test-anticipator.test.js.map