zabbix-graphql-api/src/test/logger_config.test.ts
Andreas Hilbig 7adaf82c1b chore: add tests for schema and API config mocking
- Added unit tests for schema loader, mocking Config variables and resolvers.
- Added unit tests for Zabbix API configuration, verifying constants derived from Config.
- Mocked relevant modules and filesystem behaviors to enable isolated testing.
- Optimized imports on all files and include this within a new .junie/guidelines.md file
2026-01-28 07:34:08 +01:00

18 lines
555 B
TypeScript

// Import after mocking Config
import {logger, Loglevel} from "../logging/logger.js";
// Mocking Config
jest.mock("../common_utils.js", () => ({
Config: {
LOG_LEVELS: "ERROR,INFO"
}
}));
describe("Logger Config Mocking", () => {
test("logger levels are initialized from Config", () => {
expect(logger.levels).toBeDefined();
expect(logger.levels?.has(Loglevel.ERROR)).toBe(true);
expect(logger.levels?.has(Loglevel.INFO)).toBe(true);
expect(logger.levels?.has(Loglevel.DEBUG)).toBe(false);
});
});