"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const logger_1 = require("../src/logger");
describe('logger', () => {
    beforeEach(() => {
        (0, logger_1.setLogCallback)(null);
    });
    describe('setLogCallback', () => {
        it('should set the global log callback', () => {
            const callback = jest.fn();
            (0, logger_1.setLogCallback)(callback);
            expect(logger_1.globalLogCallback).toBe(callback);
        });
        it('should allow setting null callback', () => {
            (0, logger_1.setLogCallback)(null);
            expect(logger_1.globalLogCallback).toBeNull();
        });
    });
    describe('getLogLevel', () => {
        it('should return current log level', () => {
            const level = (0, logger_1.getLogLevel)();
            expect(Object.keys(logger_1.LOG_LEVELS)).toContain(level);
        });
    });
    describe('setLogLevel', () => {
        it('should set valid log levels', () => {
            (0, logger_1.setLogLevel)('debug');
            expect((0, logger_1.getLogLevel)()).toBe('debug');
            (0, logger_1.setLogLevel)('info');
            expect((0, logger_1.getLogLevel)()).toBe('info');
            (0, logger_1.setLogLevel)('warn');
            expect((0, logger_1.getLogLevel)()).toBe('warn');
            (0, logger_1.setLogLevel)('error');
            expect((0, logger_1.getLogLevel)()).toBe('error');
        });
        it('should throw error for invalid log level', () => {
            // @ts-expect-error Testing invalid input
            expect(() => (0, logger_1.setLogLevel)('invalid')).toThrow('Invalid log level: invalid');
        });
    });
});
//# sourceMappingURL=logger.test.js.map