add test, and fix script

This commit is contained in:
Warunee Tamkoo 2026-02-09 17:45:50 +07:00
parent 638362df1c
commit f9d626a499
6 changed files with 653 additions and 73 deletions

17
src/__tests__/setup.ts Normal file
View file

@ -0,0 +1,17 @@
// Test setup file for Jest
// Mock environment variables
process.env.NODE_ENV = 'test';
process.env.DB_HOST = 'localhost';
process.env.DB_PORT = '3306';
process.env.DB_USERNAME = 'test';
process.env.DB_PASSWORD = 'test';
process.env.DB_DATABASE = 'test_db';
// Mock console methods to reduce noise in tests
global.console = {
...console,
error: jest.fn(),
warn: jest.fn(),
info: jest.fn(),
log: jest.fn(),
};