feat: add Jest testing framework and implement unit tests for configuration and service logic

This commit is contained in:
Shrev Dev
2025-10-21 11:08:26 -05:00
parent 526298bea4
commit 4ee1442589
12 changed files with 4517 additions and 3 deletions
+19
View File
@@ -0,0 +1,19 @@
// Test setup file
import { config } from '../src/config/config';
// Mock environment variables for testing
process.env.DISCORD_BOT_TOKEN = 'test-token';
process.env.UPTIME_KUMA_URL = 'http://localhost:3001';
process.env.UPTIME_KUMA_USERNAME = 'test-user';
process.env.UPTIME_KUMA_PASSWORD = 'test-password';
process.env.HEALTH_PORT = '3000';
// Mock console methods to reduce noise in tests
global.console = {
...console,
log: jest.fn(),
debug: jest.fn(),
info: jest.fn(),
warn: jest.fn(),
error: jest.fn(),
};