"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const dependency_health_checker_1 = require("../dependency-health-checker");
describe('DependencyHealthChecker', () => {
    let checker;
    beforeEach(() => {
        checker = new dependency_health_checker_1.DependencyHealthChecker();
    });
    test('detects up-to-date dependency', () => {
        const deps = { lodash: '4.17.21' };
        const latest = { lodash: '4.17.21' };
        const reports = checker.check(deps, latest);
        expect(reports[0].status).toBe('up_to_date');
    });
    test('detects minor behind', () => {
        const deps = { lodash: '4.16.0' };
        const latest = { lodash: '4.17.21' };
        const reports = checker.check(deps, latest);
        expect(reports[0].status).toBe('minor_behind');
    });
    test('detects major behind', () => {
        const deps = { react: '17.0.0' };
        const latest = { react: '18.0.0' };
        const reports = checker.check(deps, latest);
        expect(reports[0].status).toBe('major_behind');
        expect(reports[0].breakingChanges).toBe(true);
    });
    test('detects deprecated', () => {
        const deps = { oldlib: '1.0.0' };
        const latest = { oldlib: '4.0.0' };
        const reports = checker.check(deps, latest);
        expect(reports[0].status).toBe('deprecated');
    });
    test('getNonBreakingUpdates filters correctly', () => {
        const deps = { lodash: '4.17.0', react: '17.0.0' };
        const latest = { lodash: '4.17.21', react: '18.0.0' };
        const reports = checker.check(deps, latest);
        const nonBreaking = checker.getNonBreakingUpdates(reports);
        expect(nonBreaking.every((r) => !r.breakingChanges)).toBe(true);
    });
    test('getStats returns correct structure', () => {
        const deps = { a: '1.0.0', b: '2.0.0' };
        const latest = { a: '1.0.0', b: '3.0.0' };
        const reports = checker.check(deps, latest);
        const stats = checker.getStats(reports);
        expect(stats.total).toBe(2);
        expect(stats.upToDate + stats.outdated).toBe(2);
    });
});
//# sourceMappingURL=dependency-health-checker.test.js.map