mirror of
https://github.com/BrenBroZAYT/uptime-kuma-discord-bot.git
synced 2026-06-17 00:30:05 +00:00
feat: add Jest testing framework and implement unit tests for configuration and service logic
This commit is contained in:
@@ -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(),
|
||||
};
|
||||
Reference in New Issue
Block a user